Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 15/umbraco-cms/extending/language-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ With language files, you can also:
* Override existing (core) localizations.
* Define localization for your own package.

### [UI Localization](../../customizing/ui-localization.md)
### [UI Localization](../../customizing/foundation/localization.md)

Defines how to use the UI Umbraco Localization. This is the primary source of localization for the backoffice.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" %}
Property descriptions support [Umbraco Flavored Markdown](../../../reference/umbraco-flavored-markdown), which uses a different syntax (wrapped in brackets) to avoid conflicts with Markdown headers.
{% endhint %}

![Applying localization to a property](../images/localization-document-type-editor-validation.png)

* 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.
* Enable `Allow at root` in the **Structure** tab.

![Applying localization to a Document Type](../images/localization-document-type-editor.png)

3. When creating and editing the content, you will see that the backoffice now uses the configured localizations.&#x20;
3. When creating and editing the content, you will see that the backoffice now uses the configured localizations.
Copy link
Contributor

@eshanrnh eshanrnh Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the localized content is not displayed. This is what I see:
image


![Localized document creation dialog](../images/localization-document-editor-create.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.