Localization
Using the available context to handle localization for an UI Builder collection
The localization context enables developers to use multilingual collection names and descriptions in fluent configurations. It also supports translations for actions, context apps, dashboards, sections, and trees.
To enable localization, prefix the input string with the # character.
Upon character identification in the fluent configuration, the localization context will attempt to lookup a matching localized string using two services available. If no matching record is found, it will default to the provided string value.
Supported areas:
Collections -
NameandDescriptionproperties.Data Views - only if the key is in a localization resource, not in the translation dictionary (learn more about additional localization).
Collection filters -
LabelandDescriptionproperties.Cards
Editor fields -
LabelandDescriptionfield properties.Fieldsets names
Actions names
Context Apps names
Dashboards names
Sections names
Localization Services
The localization context uses two abstractions to provide localization options.
The first uses the Umbraco translations dictionary to retrieve a value based on a provided key.
The second uses the CMS ILocalizedTextService to retrieve a value based on area and alias. These values are supplied in the collection's fluent configuration, separated by an underscore _ from the localization resources.
Example
Localizing a Collection
For a Students collection, use the following fluent configuration:

Alternatively, you can use the lowercase version:
Define the translation in your localization dictionary file:

Localizing a Section
For a custom section, use the following configuration:

Localizing an additional area
When the implemented localization does not cover a specific area, you can update it directly in the fluent configuration by using the LocalizationContext.
See the following custom data view code snippet for an example:
Last updated
Was this helpful?