Document Type Localization
Setup localization for Document Types in the Umbraco backoffice.
The Umbraco backoffice is localized to match the user's configured UI Culture.
When defining a Document Type, 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 three-step process:
Register the Document Type localization files via a new manifest 'umbraco-package.json' file.
Create the localizations in user defined Document Type localization files.
Apply the localizations to the Document Type.
Registering Document Type localization Files
To register Document Type localizations, you must create a new manifest using an umbraco-package.json file.
{
"name": "Document Type Localization",
"extensions": [
{
"type": "localization",
"alias": "DocumentType.Localize.En",
"name": "English",
"meta": {
"culture": "en"
},
"js": "/App_Plugins/DocumentTypeLocalization/doctype-en.js"
}
]
}Creating localizations
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:
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 Article pages.'
},
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.',
}
};Applying localizations
The localizations are applied by using the syntax #{area alias}_{key alias}.
Create a Document Type with Template called
#contentTypes_articlewith the alias:articlePage.Under the newly created Document Type, follow these steps:
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_titlewith aliastitle.Set the description to
{#properties_title-desc}.Use a
TextStringeditor.Set the field validation to
mandatory.Under validation add
#properties_title-message.

Add a property called
#properties_subTitlewith aliassubTitle.Set the description to
{#properties_subTitle-desc}.Use a
TextStringeditor.
Enable
Allow at rootin the Structure tab.

When creating and editing the content, you will see that the backoffice now uses the configured localizations.

Create a new "Article" node:

When trying to save the node without adding the mandatory content, you will see a warning as expected:

Last updated
Was this helpful?