Adding Language Variants
Last updated
Last updated
Now that we have a basic site setup, let us make it multilingual by creating content variations in another language. In this tutorial, we will create a Danish version of the HomePage
.
To add a new language, follow these steps:
Go to the Settings section.
Go to Languages.
Click Create.
Select a Language from the dropdown list. In this tutorial, we will pick Danish.
In Settings, to set the new language as the:
Default language for your site, toggle Default Language.
Mandatory language for your site, toggle Mandatory Language.
Select a Fallback Language from the drop-down list.
Click Submit.
Click Save.
To enable language variants on Document Types, follow these steps:
Go to the Settings section.
Select HomePage from the Document Types folder.
Go to the Settings tab and toggle Allow vary by culture
Click Save.
Go to the Design tab.
Click on the Data Type of the Page Title and enable Vary by culture.
Click Submit.
Click Save.
To add culture and hostnames, follow these steps:
Go to the Content section.
Click on the ... dots next to the Home Page content node.
Select Culture and Hostnames.
Add a domain for each hostname, like it's done here:
Click Save.
You will find a language dropdown above your content tree. If it's not there, you might need to refresh the page:
In the language dropdown, you will find all the languages that you have installed for your site. You can switch between them to update the content variations for each language.
To add language variants to the content, follow these steps:
Go to the Home Page node. You will find a language dropdown next to the title at the top.
Click on the dropdown. You will see a Split view option next to the new language.
Click Split view. We can now see the content node with each language side by side.
You may notice that the bodytext is greyed out - this is because we haven't checked the Vary by culture checkbox.
Enter the Name for your content node and the Page Title in the new language.
Click Save and Publish.
The Ready to Publish window opens providing the option to publish in one or more languages.
You can select either one or multiple languages and click Save and Publish.
To view the language variant on the browser, follow these steps:
Go to the Content section.
Select your new language from the language dropdown above your content tree.
Select the Home Page node and go to the Info tab.
You will notice the links with the new language domain added to it. If it's not there, you might need to refresh the page.
Click on the link to view the new language node in the browser.
Alternatively, you can add the domain name to your localhost in the browser. For example: http://localhost:xxxx/da/
Further information on multi-language setups can be found in the Creating a Multilingual Site tutorial.