From f51479466a2ce12e3cc56a0b32269a0f740e53ab Mon Sep 17 00:00:00 2001 From: Lili-Rossiter Date: Tue, 26 Aug 2025 14:20:57 +0100 Subject: [PATCH 1/4] Updates to doctype localization v16 --- .../document-type-localization.md | 56 ++++++++++++------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md index 317b0891eb2..01590d2c543 100644 --- a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md +++ b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md @@ -1,14 +1,10 @@ --- -description: Here you will learn how to apply localization for Document Types in Umbraco. +description: Setup localization for Document Types in the Umbraco backoffice. --- # Document Type Localization -{% hint style="warning" %} -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. -{% endhint %} - -The Umbraco backoffice is localized to match the [user's configured language](../users/README.md). +The Umbraco backoffice is localized to match the [user's configured UI Culture](../../../tutorials/multilanguage-setup#changing-the-default-backoffice-language-of-a-user). When defining a Document Type, you can apply localization to: @@ -17,20 +13,42 @@ When defining a Document Type, you can apply localization to: * Custom property validation messages. * Tab and group names. -Setting up localization for Document Types is a two-step process: +{% hint style="info" %} +Everything in this article also applies to defining [Media Types](../../backoffice#media-types) and [Member Types](../../backoffice#member-types). +{% endhint %} + +## Register Document Type localization Files -* Create the localizations in [user defined backoffice localization file](../../../customizing/foundation/localization.md). -* Apply the localizations to the Document Type. +To register Document Type localizations, you must create a new manifest using an `umbraco-package.json` file. {% hint style="info" %} -Everything in this article also applies to defining [Media Types](../creating-media/) and Member Types. +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. {% endhint %} +{% code title="umbraco-package.json" %} +```json +{ + "name": "Document Type Localization", + "extensions": [ + { + "type": "localization", + "alias": "DocumentType.Localize.En", + "name": "English", + "meta": { + "culture": "en" + }, + "js": "/App_Plugins/DocumentTypeLocalization/en.js" //replace js file path as required + } + ] +} +``` +{% endcode %} + ## Creating localizations -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: +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: -{% code title="doctype-en.js" lineNumbers="true" %} +{% code title="en.js" lineNumbers="true" %} ```js export default { contentTypes: { @@ -65,16 +83,16 @@ Umbraco must be restarted to register the localization manifest. Any subsequent The localizations are applied by using the syntax `#{area alias}_{key alias}`. -1. Create a **Document Type with template** called `#contentTypes_article` with **alias**: `articlePage`. +1. Create a **Document Type with Template** called `#contentTypes_article` with the **alias**: `articlePage`. 2. Under the newly created Document Type follow these steps: -* Name the **description** to `#contentTypes_article-desc`. +* Set the **description** to `#contentTypes_article-desc`. * Create a new **tab** called `#tabs_content`. * Add a new **group** called `#groups_titles`. * Add a **property** called `#properties_title` with **alias** `title`. - * Set description to `{#properties_title-desc}`. + * Set the description to `{#properties_title-desc}`. * Use a `TextString` editor. - * Enable to `Set this field as mandatory`. + * Set the field validation to `mandatory`. * Under validation add `#properties_title-message`. {% hint style="info" %} @@ -84,7 +102,7 @@ Property descriptions support [Umbraco Flavored Markdown](../../../reference/umb ![Applying localization to a property](../images/localization-document-type-editor-validation-v15.png) * Add a **property** called `#properties_subTitle` with **alias** `subTitle`. - * Set description to `{#properties_subTitle-desc}`. + * Set the description to `{#properties_subTitle-desc}`. * Use a `TextString` editor. * Enable `Allow at root` in the **Structure** tab. @@ -94,10 +112,10 @@ Property descriptions support [Umbraco Flavored Markdown](../../../reference/umb ![Localized document creation dialog](../images/localization-document-editor-create.png) -4. Create a new "Article" content: +4. Create a new "Article" node: ![Localized document editing](../images/localization-document-editor-v15.png) -4. When trying to save the content without adding the mandatory content, you will see a warning as expected: +5. When trying to save the node without adding the mandatory content, you will see a warning as expected: ![Localized property validation](../images/localization-document-editor-validation.png) From d6d7023325ee1c54e90b3e691974e90074ee3b58 Mon Sep 17 00:00:00 2001 From: Lili-Rossiter Date: Tue, 26 Aug 2025 14:37:47 +0100 Subject: [PATCH 2/4] doctype-en.js --- .../data/defining-content/document-type-localization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md index 01590d2c543..bcf2f92d50c 100644 --- a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md +++ b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md @@ -37,7 +37,7 @@ The `umbraco-package.json` file is only registered when placed directly in the ` "meta": { "culture": "en" }, - "js": "/App_Plugins/DocumentTypeLocalization/en.js" //replace js file path as required + "js": "/App_Plugins/DocumentTypeLocalization/doctype-en.js" //replace js file path as required } ] } @@ -48,7 +48,7 @@ The `umbraco-package.json` file is only registered when placed directly in the ` 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: -{% code title="en.js" lineNumbers="true" %} +{% code title="doctype-en.js" lineNumbers="true" %} ```js export default { contentTypes: { From 5513a669a954f50f3dc4f925d15e5d5b2d48ff6d Mon Sep 17 00:00:00 2001 From: Lili-Rossiter Date: Tue, 26 Aug 2025 14:44:18 +0100 Subject: [PATCH 3/4] remove comment from json code sample as it is invalid --- .../data/defining-content/document-type-localization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md index bcf2f92d50c..395dd11a6a0 100644 --- a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md +++ b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md @@ -37,7 +37,7 @@ The `umbraco-package.json` file is only registered when placed directly in the ` "meta": { "culture": "en" }, - "js": "/App_Plugins/DocumentTypeLocalization/doctype-en.js" //replace js file path as required + "js": "/App_Plugins/DocumentTypeLocalization/doctype-en.js" } ] } From e0ae57fac584c6cc044dcab8311ac77bd1f8e0db Mon Sep 17 00:00:00 2001 From: Lili-Rossiter Date: Tue, 26 Aug 2025 15:16:30 +0100 Subject: [PATCH 4/4] updated two step process to three steps --- .../data/defining-content/document-type-localization.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md index 395dd11a6a0..d90a16fe190 100644 --- a/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md +++ b/16/umbraco-cms/fundamentals/data/defining-content/document-type-localization.md @@ -13,11 +13,16 @@ When defining a Document Type, you can apply localization to: * Custom property validation messages. * Tab and group names. +Setting up localization for Document Types is a three-step process: +* Register the Document Type localization Files via [a new manifest 'umbraco-package.json' file](../../../customizing/extending-overview/extension-types/localization.md#registering-localization). +* Create the localizations in [user defined Document Type localization files](../../../customizing/extending-overview/extension-types/localization.md#the-localization-file). +* Apply the localizations to the Document Type. + {% hint style="info" %} Everything in this article also applies to defining [Media Types](../../backoffice#media-types) and [Member Types](../../backoffice#member-types). {% endhint %} -## Register Document Type localization Files +## Registering Document Type localization Files To register Document Type localizations, you must create a new manifest using an `umbraco-package.json` file.