Language Variants
Learn how to use language variants to output your content in multiple languages.
Language Variants allows you to vary content by culture, so you can allow a content node to exist in multiple languages.
This article will cover the different aspects of enabling and working with language variants on your Umbraco website.
Contents
Video tutorial
How to enable Language Variants
To work with Language Variants you need to have more than one language enabled. This can be done from the Settings
section:
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-d8e66c08b24ff78ab332ae423a7308c4fab86c64%252Flanguages_v10.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=299dacb5&sv=1)
You will always have one default language but each language can be set to mandatory.
Enabling Language Variants on Document Types
Now that there are two languages to vary the content with, it needs to be enabled on the Document Types. To do so:
Go to the Document Type in the Settings section.
Open the Permissions page.
Toggle Allow vary by culture.
To allow a property on the Document Type to be varied it will have to be enabled for the property:
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-fd949f8dad9b9228d9ffcb0ebb3ea4e08f079592%252Fvarying-properties_v10.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=d7bfbf45&sv=1)
Working with Language Variants on content
When you return to your content node you will notice two things:
At the top of the Content tree there will now be a dropdown so you can show the Content tree in the language of your choice.
To the right of the content name there is now a dropdown where you can select a language. You can also open a split view so you can see two languages at once.
Allowing variance on properties
Each Property Editor that does not allow variants (an Invariant Property) will by default need to be unlocked in order to be edited. The lock exists to make it clear that this change will affect more languages. Since the value of the invariant properties are shared between all variants on the website.
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-7159ba8b58aeb60d089a36a6514e9cbfb045d5aa%252Finvariant-property-locked.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=a9e1ac5&sv=1)
Whether or not the lock is enabled on the invariant properties depends on the AllowEditInvariantFromNonDefault
setting in the appsettings.json
file.
For projects created on Umbraco version 10.2 or later, the setting is true
, by default. If the project is upgraded to version 10.2 or later, the setting will by default be false
.
Learn more about the AllowEditInvariantFromNonDefault
setting in the Security Settings article.
To read about how you render variant content in Templates, check out the rendering content section.
Test your language variants
Culture and hostnames must be added to your language sites before the content can be tested for variants:
Right-click the Home node and select Culture and hostnames....
Add a specific URL per language and save. For eg: An English language variant with English (United States) as the language can be given a specific URL https://yourwebsite.com/en-us and a Danish language variant can be given a specific URL https://yourwebsite.com/dk.
The Info content app should now show specific URLs for your language variants.
Control User Group permissions on language variants
This feature is available from Umbraco version 10.2.
When you are working with a multilingual site you might want to control who can edit the different variations of the content on the website.
This can be controlled on a User Group level. All default User Groups, except the Sensitive data group, have access to all languages out of the box.
When "Allow access to all languages" is not checked, languages can be added and/or removed. This is to determine which variants the users in the user group have access to.
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-ef317d0390434de0f6ec8b8b37adc81805f72258%252FAssign-Access-Languages.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=f74407dd&sv=1)
Even though the language permissions have been set, a user will still be able to view and browse all the language variations. The permission setting will ensure that only the added languages are editable by users of the User Group.
Related Links
Last updated