Sitefinity CMS 13.1 has introduced changes to its Native API for working with multilingual content. The previous multilingual APIs are deprecated and no longer work, starting with Sitefinity CMS 13.1.
In this article, you learn how to migrate your existing code to the new APIs.
You can use the following APIs starting with Sitefinity 13.1:
The following code shows how to use the new CultureRegion code to set a specific culture/language for a part of your code.
Create News Item
IMPORTANT: The following are breaking changes starting with Sitefinity 13.1:
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
The following APIs are deprecated, starting with Sitefinity 13.1. If you used them in your solution based on Sitefinity CMS version older than 13.1, substitute their usage with the new APIs described below:
To get all languages and default language for the current site, use one of the following:
To retrieve information for languages in Administration » Settings » Languages, use AppSettings.CurrentSettings with the following properties:
The following APIs are available starting with Sitefinity CMS 13.1 and above and are the new alternatives to the above-described deprecated API. When upgrading to Sitefinity CMS version 13.1 and above, you need to rewrite your code to use the new API.
The SystemManager class is the single API entry point for getting information for the cultures and languages in Sitefinity CMS.
To get all languages and default language for the current site, use SystemManager.CurrentContext.CurrentSite with the following methods:
To retrieve information for languages in Administration » Settings » Languages, use SystemManager.CurrentContext with the following methods:
To see if the current site has more than one language, use the following code: SystemManager.CurrentContext.CurrentSite.Cultures.Count() > 1
SystemManager.CurrentContext.CurrentSite.Cultures.Count() > 1
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important