Document Type Localization
Here you will learn how to apply localization for Document Types in Umbraco.
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.
The Umbraco backoffice is fully localized to match the user's configured language. When defining Document Types, you can apply localization to:
Document Type names and descriptions.
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.
Apply the localizations to the Document Types.
Everything in this article also applies to defining Media Types.
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:
Umbraco must be restarted to pick up on changes to language files.
Applying localizations
The localizations are applied by using the syntax #{area alias}_{key alias}
.
Create a Document Type with template called
#contentTypes_article
with alias:articlePage
.Under the newly created document type follow these steps:
Name 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 aliastitle
.Set description to
#properties_title-desc
.Use a
TextString
editor.Enable to
Set this field as mandatory
.Under validation add
#properties_title-message
.
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-d8d55126d030461acbc97b0bd031400827d29980%252Flocalization-document-type-editor-validation.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=1455aada&sv=1)
Add a property called
#properties_subTitle
with aliassubTitle
.Set description to
#properties_subTitle-desc
.Use a
TextString
editor.
Enable to
Allow as root
in the Permissions tab.
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-c020c7fa7577916f9e10d5610c3ca9e66e6585d6%252Flocalization-document-type-editor.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=ccbd1113&sv=1)
When creating and editing the content, you will see that the backoffice now uses the configured localizations.
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-58b02eb6b1c7fc91622b40689087dc92743bb36c%252Flocalization-document-editor-create.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=8e2da5bf&sv=1)
Create a new "Article" content:
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-c47f8f8bc71efb73159bb89be7954005a220068e%252Flocalization-document-editor.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=94c327b1&sv=1)
When trying to save the content without adding the mandatory content, you will see a warning as expected:
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F3701346516-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG1Byxw7XfiZAj8zDMCTD%252Fuploads%252Fgit-blob-a81ce08060873ef2f487955a1375576e419ab570%252Flocalization-document-editor-validation.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=72872bea&sv=1)
Last updated