With the decoupled Sitefinity .NET Core Renderer, you can localize your application by utilizing several techniques. These techniques are applicable in different scenarios.
All the techniques described in this article are dependent on the currently requested version of the page that is being rendered. The Renderer automatically determines the language of the page and passes it to the .NET Core APIs. This is done in the following way:
Thread.CurrentUICulture
IRequestContext
IRequestCultureProvider
Use this approach when you want to localize labels that will be managed by developers. They are stored in the source control and are be deployed through CI/CD.
This approach utilizes the built-in .NET Core APIs. When you use this approach, you are able to localize any resource in your application – both in the views and the VewComponents. For more information, see Globalization and localization in ASP.NET Core.
VewComponents
Use this approach to localize content. This is the most common localization, used by content editors. It allows content editors to translate content without involving a developer.
This type of localization minimizes the customizations of the project and keeps it clean and simple.You do this when you create content and then translate it manually or through the Translation service. For more information, see Languages and Translations.
After the translation, the localized version of the content is displayed on the frontend, depending on the currently selected language of the page. This is handled automatically by built-in widgets, such as Content list or Image widget, and also by custom widgets that use the automatically generated widget designers. For more information, see Autogenerated field types.
The translated version of the content is fetched automatically even in custom implementations, when you call the services directly, using the IRestClient interface and its methods Get<TItem> and GetItems<TItem>.
IRestClient
Get<TItem>
GetItems<TItem>
Use this approach when you want allow localization of particular widgets and their properties. You do this by exposing the localized resources as properties in the widget designers.
This allows non-developers to translate the properties manually through the widget designers. For more information, see Autogenerated field types.
After the translation, the widget resolves the version of the properties for the current language of the page. Except for the Section widget, all the other widgets support property localization and each property can be localized independently. Additionally, when working on a synced page, you can override all translated versions with the current one, by saving the widget with the option Save all translations.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important