Here you will learn how to apply localization for Document Types in Umbraco.
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.
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.
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 alias title
.
Set description to #properties_title-desc
.
Use a TextString
editor.
Enable to Set this field as mandatory
.
Under validation add #properties_title-message
.
Add a property called #properties_subTitle
with alias subTitle
.
Set description to #properties_subTitle-desc
.
Use a TextString
editor.
Enable to Allow as root
in the Permissions tab.
When creating and editing the content, you will see that the backoffice now uses the configured localizations.
Create a new "Article" content:
When trying to save the content without adding the mandatory content, you will see a warning as expected: