Skip to content

Commit f514794

Browse files
committed
Updates to doctype localization v16
1 parent 1137381 commit f514794

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

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

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
---
2-
description: Here you will learn how to apply localization for Document Types in Umbraco.
2+
description: Setup localization for Document Types in the Umbraco backoffice.
33
---
44

55
# Document Type Localization
66

7-
{% hint style="warning" %}
8-
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.
9-
{% endhint %}
10-
11-
The Umbraco backoffice is localized to match the [user's configured language](../users/README.md).
7+
The Umbraco backoffice is localized to match the [user's configured UI Culture](../../../tutorials/multilanguage-setup#changing-the-default-backoffice-language-of-a-user).
128

139
When defining a Document Type, you can apply localization to:
1410

@@ -17,20 +13,42 @@ When defining a Document Type, you can apply localization to:
1713
* Custom property validation messages.
1814
* Tab and group names.
1915

20-
Setting up localization for Document Types is a two-step process:
16+
{% hint style="info" %}
17+
Everything in this article also applies to defining [Media Types](../../backoffice#media-types) and [Member Types](../../backoffice#member-types).
18+
{% endhint %}
19+
20+
## Register Document Type localization Files
2121

22-
* Create the localizations in [user defined backoffice localization file](../../../customizing/foundation/localization.md).
23-
* Apply the localizations to the Document Type.
22+
To register Document Type localizations, you must create a new manifest using an `umbraco-package.json` file.
2423

2524
{% hint style="info" %}
26-
Everything in this article also applies to defining [Media Types](../creating-media/) and Member Types.
25+
The `umbraco-package.json` file is only registered when placed directly in the `/App_Plugins/` or `/App_Plugins/{SubFolderName}` folder. It will not be recognized in nested subfolders.
2726
{% endhint %}
2827

28+
{% code title="umbraco-package.json" %}
29+
```json
30+
{
31+
"name": "Document Type Localization",
32+
"extensions": [
33+
{
34+
"type": "localization",
35+
"alias": "DocumentType.Localize.En",
36+
"name": "English",
37+
"meta": {
38+
"culture": "en"
39+
},
40+
"js": "/App_Plugins/DocumentTypeLocalization/en.js" //replace js file path as required
41+
}
42+
]
43+
}
44+
```
45+
{% endcode %}
46+
2947
## Creating localizations
3048

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:
49+
Once you have registered the Document Type localization, you can add your localization texts for use in Document Types. The following localizations are used for the samples in this article:
3250

33-
{% code title="doctype-en.js" lineNumbers="true" %}
51+
{% code title="en.js" lineNumbers="true" %}
3452
```js
3553
export default {
3654
contentTypes: {
@@ -65,16 +83,16 @@ Umbraco must be restarted to register the localization manifest. Any subsequent
6583

6684
The localizations are applied by using the syntax `#{area alias}_{key alias}`.
6785

68-
1. Create a **Document Type with template** called `#contentTypes_article` with **alias**: `articlePage`.
86+
1. Create a **Document Type with Template** called `#contentTypes_article` with the **alias**: `articlePage`.
6987
2. Under the newly created Document Type follow these steps:
7088

71-
* Name the **description** to `#contentTypes_article-desc`.
89+
* Set the **description** to `#contentTypes_article-desc`.
7290
* Create a new **tab** called `#tabs_content`.
7391
* Add a new **group** called `#groups_titles`.
7492
* Add a **property** called `#properties_title` with **alias** `title`.
75-
* Set description to `{#properties_title-desc}`.
93+
* Set the description to `{#properties_title-desc}`.
7694
* Use a `TextString` editor.
77-
* Enable to `Set this field as mandatory`.
95+
* Set the field validation to `mandatory`.
7896
* Under validation add `#properties_title-message`.
7997

8098
{% hint style="info" %}
@@ -84,7 +102,7 @@ Property descriptions support [Umbraco Flavored Markdown](../../../reference/umb
84102
![Applying localization to a property](../images/localization-document-type-editor-validation-v15.png)
85103

86104
* Add a **property** called `#properties_subTitle` with **alias** `subTitle`.
87-
* Set description to `{#properties_subTitle-desc}`.
105+
* Set the description to `{#properties_subTitle-desc}`.
88106
* Use a `TextString` editor.
89107
* Enable `Allow at root` in the **Structure** tab.
90108

@@ -94,10 +112,10 @@ Property descriptions support [Umbraco Flavored Markdown](../../../reference/umb
94112

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

97-
4. Create a new "Article" content:
115+
4. Create a new "Article" node:
98116

99117
![Localized document editing](../images/localization-document-editor-v15.png)
100118

101-
4. When trying to save the content without adding the mandatory content, you will see a warning as expected:
119+
5. When trying to save the node without adding the mandatory content, you will see a warning as expected:
102120

103121
![Localized property validation](../images/localization-document-editor-validation.png)

0 commit comments

Comments
 (0)