Skip to content

Commit 27f7184

Browse files
authored
Merge pull request #6909 from leekelleher/v15/document-type-localization
V15: Document Type Localization updates
2 parents a836403 + 571e358 commit 27f7184

File tree

4 files changed

+43
-42
lines changed

4 files changed

+43
-42
lines changed

15/umbraco-cms/extending/language-files/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ With language files, you can also:
1515
* Override existing (core) localizations.
1616
* Define localization for your own package.
1717

18-
### [UI Localization](../../customizing/ui-localization.md)
18+
### [UI Localization](../../customizing/foundation/localization.md)
1919

2020
Defines how to use the UI Umbraco Localization. This is the primary source of localization for the backoffice.
2121

15/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,57 @@ description: Here you will learn how to apply localization for Document Types in
88
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
99
{% endhint %}
1010

11-
The Umbraco backoffice is fully localized to match the user's [configured language](../users.md). When defining Document Types, you can apply localization to:
11+
The Umbraco backoffice is localized to match the [user's configured language](../users/README.md).
1212

13-
* Document Type names and descriptions.
13+
When defining a Document Type, you can apply localization to:
14+
15+
* Document Type name and description.
1416
* Property names and descriptions.
1517
* Custom property validation messages.
1618
* Tab and group names.
1719

1820
Setting up localization for Document Types is a two-step process:
1921

20-
* Create the localizations in [user defined language files](../../../extending/language-files/README.md).
21-
* Apply the localizations to the Document Types.
22+
* Create the localizations in [user defined backoffice localization file](../../../customizing/foundation/localization.md).
23+
* Apply the localizations to the Document Type.
2224

2325
{% hint style="info" %}
24-
Everything in this article also applies to defining [Media Types](../creating-media/).
26+
Everything in this article also applies to defining [Media Types](../creating-media/) and Member Types.
2527
{% endhint %}
2628

2729
## Creating localizations
2830

29-
User defined language files are created in `/config/lang` and must be named `{language}.user.xml`. For example: `en-us.user.xml`.
30-
31-
There are no specific requirements as to how localizations should be structured for use in Document Types. The following localizations have been used for the samples in this article:
32-
33-
{% code title="en-us.user.xml" lineNumbers="true" %}
34-
35-
```xml
36-
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
37-
<language>
38-
<area alias="contentTypes">
39-
<key alias="article">Article page</key>
40-
<key alias="article-desc">A textual, article-like page on the site. Use this as the main type of content.</key>
41-
<key alias="landing">Landing page</key>
42-
<key alias="landing-desc">An inviting, very graphical page. Use this as an entry point for a campaign, and supplement with Articles.</key>
43-
</area>
44-
<area alias="tabs">
45-
<key alias="content">Page content</key>
46-
<key alias="seo">SEO configuration</key>
47-
</area>
48-
<area alias="groups">
49-
<key alias="titles">Page titles</key>
50-
</area>
51-
<area alias="properties">
52-
<key alias="title">Main title</key>
53-
<key alias="title-desc">This is the main title of the page.</key>
54-
<key alias="title-message">The main title is required for this page.</key>
55-
<key alias="subTitle">Sub title</key>
56-
<key alias="subTitle-desc">This is the sub title of the page.</key>
57-
</area>
58-
</language>
31+
Once you have [registered a backoffice localization file](../../../customizing/extending-overview/extension-types/localization.md), you can add your localization texts for use in Document Types. The following localizations are used for the samples in this article:
32+
33+
{% code title="doctype-en.js" lineNumbers="true" %}
34+
```js
35+
export default {
36+
contentTypes: {
37+
article: 'Article page',
38+
'article-desc': 'A textual, article-like page on the site. Use this as the main type of content.',
39+
landing: 'Landing page',
40+
'landing-desc': 'An inviting, very graphical page. Use this as an entry point for a campaign, and supplement with Articles.'
41+
},
42+
tabs: {
43+
content: 'Page content',
44+
seo: 'SEO configuration',
45+
},
46+
groups: {
47+
titles: 'Page titles'
48+
},
49+
properties: {
50+
title: 'Main title',
51+
'title-desc': 'This is the main title of the page.',
52+
'title-message': 'The main title is required for this page.',
53+
subTitle: 'Sub title',
54+
'subTitle-desc': 'This is the sub title of the page.',
55+
}
56+
};
5957
```
60-
6158
{% endcode %}
6259

6360
{% hint style="info" %}
64-
Umbraco must be restarted to pick up on changes to language files.
61+
Umbraco must be restarted to register the localization manifest. Any subsequent localization text changes will need to be reloaded within the browser.
6562
{% endhint %}
6663

6764
## Applying localizations
@@ -75,21 +72,25 @@ The localizations are applied by using the syntax `#{area alias}_{key alias}`.
7572
* Create a new **tab** called `#tabs_content`.
7673
* Add a new **group** called `#groups_titles`.
7774
* Add a **property** called `#properties_title` with **alias** `title`.
78-
* Set description to `#properties_title-desc`.
75+
* Set description to `{#properties_title-desc}`.
7976
* Use a `TextString` editor.
8077
* Enable to `Set this field as mandatory`.
8178
* Under validation add `#properties_title-message`.
8279

80+
{% hint style="info" %}
81+
Property descriptions support [Umbraco Flavored Markdown](../../../reference/umbraco-flavored-markdown), which uses a different syntax (wrapped in brackets) to avoid conflicts with Markdown headers.
82+
{% endhint %}
83+
8384
![Applying localization to a property](../images/localization-document-type-editor-validation.png)
8485

8586
* Add a **property** called `#properties_subTitle` with **alias** `subTitle`.
86-
* Set description to `#properties_subTitle-desc`.
87+
* Set description to `{#properties_subTitle-desc}`.
8788
* Use a `TextString` editor.
88-
* Enable to `Allow as root` in the **Permissions** tab.
89+
* Enable `Allow at root` in the **Structure** tab.
8990

9091
![Applying localization to a Document Type](../images/localization-document-type-editor.png)
9192

92-
3. When creating and editing the content, you will see that the backoffice now uses the configured localizations.&#x20;
93+
3. When creating and editing the content, you will see that the backoffice now uses the configured localizations.
9394

9495
![Localized document creation dialog](../images/localization-document-editor-create.png)
9596

-96.5 KB
Loading
-74.6 KB
Loading

0 commit comments

Comments
 (0)