Site languages
Add up to 12 languages to a site, pick the main one, translate pages side by side or in the Translate tab, and see what visitors get.
A site can be written in up to 12 languages. One of them is the Main language: visitors see it first, and any text you have not translated yet shows in it. This page covers adding a language, choosing the main one, translating, and what changes on the public site.
Before you start #
- Adding, removing and choosing the main language need the Super admin role.
- Translating needs only edit rights on the content: Content editors and Content authors both get the translation boxes and the Translate tab.
- Decide the language codes before you add them. A code is a language, optionally followed by a region:
fr,pt-BR,es-419. Each code becomes part of the address (see What you see), soenanden-USare two different languages to the site.
Add a language #
- In the sidebar, open Site settings and choose the Languages tab.
- Under Add a language, open Language and pick one from Choose a language.
- If the language is not in the list, choose Another code… and type it in Language code. Write the language in lower case and the region in upper case:
pt-BR, notpt-br. - Select Add language.
The message "Language added." confirms it. No page changes: every page shows the main language's text in the new language until someone translates it.
Note: The editor's language switch in the top bar picks up the new language at once, without a reload.
Choose the main language #
- In Languages of this website, find the language that should become the main one.
- Select Make main language.
The message "Language is now the main language." confirms it. Wherever the new main language has no text of its own, the old main language's text is copied into it first, so no page goes blank. Review those copied texts: they are in the old language until you rewrite them.
Translate a page #
There are two places to translate. Use the inspector for one element, the Translate tab for a whole page.
In the inspector #
- Open the page in the editor and select an element with text.
- On a site with two languages, every text field shows one box per language side by side; with three or more, one tab per language.
- Type the translation in the language's box. It saves like any other edit, and ⌘ Z undoes it.
An empty box reads Not translated yet. Visitors see the main language text. Two actions help:
- Copy from language fills the box with the main language's text, so you can edit it rather than type from scratch.
- Same in all languages copies the main language's text into every language, for words that never change, such as a brand name. It is a one-off copy, not a link: after you change the main text, select it again. If another language already holds different words, it asks first (Use one text for every language?) and replaces them only when you choose Replace the translations.
In the Translate tab #
- In the editor's left column, beside Layers and Components, open Translate. (A content author sees only Translate there. The tab appears only on a site with two or more languages.)
- In Translate into, choose the language. It starts on the editing language when that is not the main one.
- The count N to translate says how many texts have no words of their own in that language. Turn on Only untranslated to hide the rest.
- Each row shows the element, the field, the main text (read-only) and the translation. Type in the translation; it saves as you go.
- Select a row's main text to select that element on the canvas.
When the count reaches zero the tab says Everything is translated.
The tab lists the open page, or the header or footer when you are editing one of them. Three kinds of text are not listed there:
- text bound to data, such as a collection field or the page title, is translated where the data lives;
- the texts inside a site component: translate them on the component's own canvas (The texts inside a site component are translated on its own canvas.); an instance lists only the texts it exposes;
- texts inside a repeater item or an object field: edit them in the inspector.
The page's title and SEO #
The page's title and its SEO fields are per language too.
- In the editor's left column, select Page details.
- Under SEO, fill SEO title and Description in each language.
The Social image is shared by all languages.
Check a language in the preview #
Use Preview language in the editor's top bar to see the page as a visitor of that language sees it, untranslated text included.
Remove a language #
- In Languages of this website, select Remove on the language.
- Read the confirmation: every text written in that language is deleted from the drafts of the site (pages, header and footer, menus, collections, settings, forms and media descriptions). A text that exists only in that language moves to the main language.
- Select Remove language to confirm.
The live site keeps the language until the next publish. This can't be undone: no undo, no version restores the drafts' texts for you. If you might need them, publish first so the texts stay in a version you can make live again (see Publish and versions).
What you see #
On the public site, after you publish:
- The main language lives at the plain address:
/,/about. Every other language is prefixed with its code in lower case:/it/,/it/about,/pt-br/about. - Page addresses (slugs) are the same in every language; only the prefix changes. Collection items are the exception: each language can have its own slug.
- Every page lists its address in each language and an
x-default(the main language) in its head and in the sitemap, so search engines show each visitor the right one. - Untranslated text shows in the main language. The page does not hide or skip it.
- The words the theme writes itself (form messages, some button labels) come in English, Italian, and Canadian French and English. A language without its own set, such as German or Spanish, shows those words in US English while the content is in the site's language.
Pitfalls #
- Twelve is the limit. At 12 languages the page says "A website has at most 12 languages." and adds no more.
- The main language cannot be removed. Make another language the main one first.
- Wrong case in a code is refused. "Write a code like “fr”, “pt-BR” or “es-419”: lowercase language, uppercase region."
- "Same in all languages" does not follow later edits. Change the main text, then select it again, or the other languages keep the old words.
- An empty required field in the main language blocks publish, even if the other languages are filled. The publish check reads the main language. See Publish and versions.
- A field called like a language code. When a language's code is also the name of a field (
idis the code of Indonesian), removing that language could take the field for a translation. Remove such a language with care.
Related #
Something wrong on this page? Write to docs@librettocms.com.