You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 16/umbraco-ui-builder/collections/localization.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,25 @@ description: Using the available context to handle localization for an UI Builde
4
4
5
5
# Localization
6
6
7
-
The localization context available in UI Builder enables developers to use multilingual collection names and descriptions with their fluent configuration, as well as translations for actions, context apps, dashboards, sections or trees.
7
+
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.
8
8
9
-
To enable localizationthe input string must be prefixed by the `#` character.
9
+
To enable localization, prefix the input string with the `#` character.
10
10
11
11
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.
12
12
13
13
## Localization Services
14
14
15
-
To provide localization options, the context is using two abstractions.
15
+
The localization context uses two abstractions to provide localization options.
16
16
17
-
One is using the Umbraco translations dictionary to retrieve a value based on a provided key.
17
+
The first uses the Umbraco translations dictionary to retrieve a value based on a provided key.
18
18
19
-
The other uses the CMS `ILocalizedTextService` to retrieve a value based on area and alias (these will be supplied in the collection's fluent configuration separated by `_`) from the localization resources.
19
+
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.
20
20
21
21
## Example
22
22
23
-
For a `Students` collection we would use the following fluent configuration:
23
+
### Localizing a Collection
24
+
25
+
For a `Students` collection, use the following fluent configuration:
24
26
25
27
```csharp
26
28
treeConfig.AddCollection<Student>(x=>x.Id, "#CollectionStudents", "#CollectionStudents", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig=>
treeConfig.AddCollection<Student>(x=>x.Id, "#collection_students", "#collection_students", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig=>
0 commit comments