Skip to content

Commit 4baa158

Browse files
committed
Update localization docs for UI Builder 16
1 parent 8f442cc commit 4baa158

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

16/umbraco-ui-builder/collections/localization.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ description: Using the available context to handle localization for an UI Builde
44

55
# Localization
66

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.
88

9-
To enable localization the input string must be prefixed by the `#` character.
9+
To enable localization, prefix the input string with the `#` character.
1010

1111
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.
1212

1313
## Localization Services
1414

15-
To provide localization options, the context is using two abstractions.
15+
The localization context uses two abstractions to provide localization options.
1616

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.
1818

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.
2020

2121
## Example
2222

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:
2426

2527
```csharp
2628
treeConfig.AddCollection<Student>(x => x.Id, "#CollectionStudents", "#CollectionStudents", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig =>
@@ -31,7 +33,7 @@ treeConfig.AddCollection<Student>(x => x.Id, "#CollectionStudents", "#Collection
3133

3234
![collection_translation](../images/collection_translation.png)
3335

34-
Or
36+
Alternatively, you can use the lowercase version:
3537

3638
```csharp
3739
treeConfig.AddCollection<Student>(x => x.Id, "#collection_students", "#collection_students", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig =>
@@ -40,6 +42,7 @@ treeConfig.AddCollection<Student>(x => x.Id, "#collection_students", "#collectio
4042
});
4143
```
4244

45+
Define the translation in your localization dictionary file:
4346
```
4447
import type { UmbLocalizationDictionary } from "@umbraco-cms/backoffice/localization-api";
4548
@@ -53,7 +56,8 @@ export default {
5356

5457
![collection_name](../images/collection_name.png)
5558

56-
For a custom section we can use the following configuration:
59+
### Localizing a Section
60+
For a custom section, use the following configuration:
5761

5862
```csharp
5963
.AddSection("#UmbracoTraining", sectionConfig =>

0 commit comments

Comments
 (0)