-
Notifications
You must be signed in to change notification settings - Fork 814
V15: Document Type Localization updates #6909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eshanrnh
merged 6 commits into
umbraco:main
from
leekelleher:v15/document-type-localization
Mar 4, 2025
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ffd9d1
Fixed UI Localization link
leekelleher bcdeabf
Updates Document Type Localization (for v15)
leekelleher 341a626
Removed rogue entity
leekelleher 96c4585
Reworded to make Vale happier
leekelleher 9c69d7b
Update 15/umbraco-cms/fundamentals/data/defining-content/document-typ…
leekelleher 571e358
Update 15/umbraco-cms/fundamentals/data/defining-content/document-typ…
leekelleher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,60 +8,57 @@ description: Here you will learn how to apply localization for Document Types in | |
| 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 fully localized to match the user's [configured language](../users.md). When defining Document Types, you can apply localization to: | ||
| The Umbraco backoffice is localized to match the [user's configured language](../users/README.md). | ||
|
|
||
| * Document Type names and descriptions. | ||
| When defining a Document Type, you can apply localization to: | ||
|
|
||
| * Document Type name and description. | ||
| * Property names and descriptions. | ||
| * Custom property validation messages. | ||
| * Tab and group names. | ||
|
|
||
| Setting up localization for Document Types is a two-step process: | ||
|
|
||
| * Create the localizations in [user defined language files](../../../extending/language-files/README.md). | ||
| * Apply the localizations to the Document Types. | ||
| * Create the localizations in [user defined backoffice localization file](../../../customizing/foundation/localization.md). | ||
| * Apply the localizations to the Document Type. | ||
|
|
||
| {% hint style="info" %} | ||
| Everything in this article also applies to defining [Media Types](../creating-media/). | ||
| Everything in this article also applies to defining [Media Types](../creating-media/) and Member Types. | ||
| {% endhint %} | ||
|
|
||
| ## Creating localizations | ||
|
|
||
| User defined language files are created in `/config/lang` and must be named `{language}.user.xml`. For example: `en-us.user.xml`. | ||
|
|
||
| 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: | ||
|
|
||
| {% code title="en-us.user.xml" lineNumbers="true" %} | ||
|
|
||
| ```xml | ||
| <?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
| <language> | ||
| <area alias="contentTypes"> | ||
| <key alias="article">Article page</key> | ||
| <key alias="article-desc">A textual, article-like page on the site. Use this as the main type of content.</key> | ||
| <key alias="landing">Landing page</key> | ||
| <key alias="landing-desc">An inviting, very graphical page. Use this as an entry point for a campaign, and supplement with Articles.</key> | ||
| </area> | ||
| <area alias="tabs"> | ||
| <key alias="content">Page content</key> | ||
| <key alias="seo">SEO configuration</key> | ||
| </area> | ||
| <area alias="groups"> | ||
| <key alias="titles">Page titles</key> | ||
| </area> | ||
| <area alias="properties"> | ||
| <key alias="title">Main title</key> | ||
| <key alias="title-desc">This is the main title of the page.</key> | ||
| <key alias="title-message">The main title is required for this page.</key> | ||
| <key alias="subTitle">Sub title</key> | ||
| <key alias="subTitle-desc">This is the sub title of the page.</key> | ||
| </area> | ||
| </language> | ||
| 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: | ||
|
|
||
| {% code title="doctype-en.js" lineNumbers="true" %} | ||
| ```js | ||
| export default { | ||
| contentTypes: { | ||
| article: 'Article page', | ||
| 'article-desc': 'A textual, article-like page on the site. Use this as the main type of content.', | ||
| landing: 'Landing page', | ||
| 'landing-desc': 'An inviting, very graphical page. Use this as an entry point for a campaign, and supplement with Articles.' | ||
| }, | ||
| tabs: { | ||
| content: 'Page content', | ||
| seo: 'SEO configuration', | ||
| }, | ||
| groups: { | ||
| titles: 'Page titles' | ||
| }, | ||
| properties: { | ||
| title: 'Main title', | ||
| 'title-desc': 'This is the main title of the page.', | ||
| 'title-message': 'The main title is required for this page.', | ||
| subTitle: 'Sub title', | ||
| 'subTitle-desc': 'This is the sub title of the page.', | ||
| } | ||
| }; | ||
| ``` | ||
|
|
||
| {% endcode %} | ||
|
|
||
| {% hint style="info" %} | ||
| Umbraco must be restarted to pick up on changes to language files. | ||
| Umbraco must be restarted to register the localization manifest. Any subsequent localization text changes will need to be reloaded within the browser. | ||
| {% endhint %} | ||
|
|
||
| ## Applying localizations | ||
|
|
@@ -75,21 +72,25 @@ The localizations are applied by using the syntax `#{area alias}_{key alias}`. | |
| * 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 description to `{#properties_title-desc}`. | ||
| * Use a `TextString` editor. | ||
| * Enable to `Set this field as mandatory`. | ||
| * Under validation add `#properties_title-message`. | ||
|
|
||
| {% hint style="info" %} | ||
| Please note, property descriptions support [Umbraco Flavored Markdown](../../../reference/umbraco-flavored-markdown). This requires a different syntax (wrapped in brackets), so not to conflict with Markdown header syntax. | ||
| {% endhint %} | ||
|
|
||
|  | ||
|
|
||
| * Add a **property** called `#properties_subTitle` with **alias** `subTitle`. | ||
| * Set description to `#properties_subTitle-desc`. | ||
| * Set description to `{#properties_subTitle-desc}`. | ||
| * Use a `TextString` editor. | ||
| * Enable to `Allow as root` in the **Permissions** tab. | ||
leekelleher marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| 3. When creating and editing the content, you will see that the backoffice now uses the configured localizations.  | ||
| 3. When creating and editing the content, you will see that the backoffice now uses the configured localizations. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|  | ||
|
|
||
|
|
||
Binary file modified
BIN
-96.5 KB
(35%)
...o-cms/fundamentals/data/images/localization-document-type-editor-validation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-74.6 KB
(36%)
15/umbraco-cms/fundamentals/data/images/localization-document-type-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.