Localized content
Introduction
There are two strategies for handling the translation of content on pages:
- Connected mode
- Translating content will create a direct connection between the original
language and the language you translate to. This means that moving an
element or setting meta information like start time or end time will be
taken from the original content and you will not be able to set these
values on a translated content element. Translated records will hold the
connection to their original language record in the
l10n_field. This mode is best for a strict translation workflow.parent - Free mode
- Copying content will take the content elements from the source language and create copies in a different language. This means that you will be able to move content elements around freely, but you will not have the benefit of being able to compare changes made in the source language later on. Use this mode, when the translated pages content can largely differ from the original language and you want to have that freedom in designing your translated website.
When you translate a page or a content element, the translation wizard asks for this choice in its step Mode, see Translating pages:
The translation wizard asks whether to translate or to copy the content
Translate creates a translation in connected mode, and Copy creates a copy in free mode. If a record has translations already, the wizard offers only their mode, so that the modes do not mix. For more details on how to translate, see the TYPO3 Editors Guide.
The backend offers to translate a content element only into the languages that its page has a translation in. To translate content into a new language, translate the page first. The translation wizard of the page can translate the content elements of the page together with it.
Connected content
If you opted for the connected content strategy, this is the default way that translated pages will be handled in the frontend and requires no further configuration in the site configuration. In the site configuration, the fallbackType "strict" would look like this:
languages:
-
# ... other language settings ...
fallbackType: strict
In this connected mode, TYPO3 will first internally fetch the records of the default language, then overlay them with the target language. If a record is not translated into the target language, then it is discarded and not shown at all.
A page in such a language shows only its translated content elements. Here, the title of the Arabic imprint is translated, but its text is not:
English
The English imprint
العربية
The Arabic imprint shows only its translated title
Another way to view connected content in the frontend is by creating a fallback chain. For this we have to adjust the site configuration and provide a comma-separated list of fallback languages:
languages:
-
# ... other language settings ...
fallbackType: fallback
# 0 = English
fallbacks: '0'
In this mode, TYPO3 also fetches the records of the default language first,
and then overlays them with the target language. If a record has no
translation in the target language, TYPO3 goes through the fallback chain
from left to right. A chain such as 1,0 tries the language with the ID 1
first, and then the default language with the ID 0.
Here, Spanish falls back to English. The Spanish imprint shows its translated title and the English text:
English
The English imprint
Español
The Spanish imprint falls back to the English text
Warning
If you want to use the "connected content" paradigm in conjunction with the setting Hide default language of page, you will need to provide placeholder content elements in the default language and translate them, since the whole frontend rendering process starts from the default language in such a configuration.
Free content
With the free mode content strategy, the site configuration will have to be adjusted accordingly:
languages:
-
# ... other language settings ...
fallbackType: free
This means, TYPO3 will directly fetch the translated records and not care about the records in the default language at all.
Tip
For more information on how to add languages and configure their behaviour in the site configuration, see Adding Languages.
The "All" language
When using overlays, it becomes possible to use a particular language called "All", which will be automatically visible across all translations. The uid of that particular language is "-1".
A content element for all languages
The view Language Comparison of the Content > Layout module shows the languages of a page side by side. An element for all languages appears only in the column of the default language. The columns of the translations stay empty, and the translation wizard does not offer the element for translation:
A content element for all languages in the language comparison
Localizing inline elements (IRRE)
When you translate a record with inline elements (IRRE), TYPO3 translates its inline elements together with it. An inline element that the original record gets later has no translation yet. The form of the translation shows it with a dashed border, and offers two buttons to translate it:
- Localize all records translates all inline elements that have no translation yet.
- The button of an inline element translates this element only.
A translated list with an item that has no translation yet
A field can also offer Synchronize with original language. It adds the missing translations, and deletes the translations whose original is gone. The TCA options showAllLocalizationLink and showSynchronizationLink of the field switch these buttons on. The lists of the Camino theme offer the first one, but not the second.