Rethinking Translation Handling
Based on the session “Rethinking translation handling” at T3CMD 2022 and some further conversations, I found encouragement from the participants to push my ideas forward and got the feedback that I should share and discuss my thoughts with members of the core development team. For this reason, I would like to write down my ideas as best I can and hope to be able to lead a lively discussion with the community.
Current Problems
The strict distinction between a concrete default language that must be defined and non-default languages (translations) in TYPO3 makes dealing with multiple languages a bit too inflexible and difficult for editors to understand.
Generally speaking, the default language has a special status in the language overlay concept and must be treated differently than non-standard languages. This leads to some editorial problems, which I would like to name as follows:
1. Distinction between “free” and “connected” mode
From an editor’s point of view, the distinction between “free” and “connected” mode in the context of content translation is difficult to understand and handle.
Example: Imagine a page where all content elements are associated with the default language. Now a new content element should only be output in the non-default language. To solve this you either create a hidden “helper” content element in the default language (Misuse of the default language as a structure provider and additional editorial effort) or you unlink all content elements of the non-default language (Loss of all features related to the connections). Both ways are not so easy to understand and have their drawbacks.
2. Translations between non-default languages
If an editor is supposed to do a translation from one non-default language to another non-default language, then he or she has no option to only display these two non-default languages in the page module. Unfortunately, the default language is always part of the display in the backend. It would be editorially desirable if any source language could be displayed instead of the default language.
Example: Imagine a website in default language German. A Spanish editor would now like to translate the English translations of this website into Spanish because he or she does not speak German. The German texts bother him in the backend and he or she would like to display the English texts instead. Since German editors also want to translate the German texts into English, a permanent change of the default language in the database is not practicable.
3. Fixed (default) language of the page tree
The page tree is always displayed in the default language. As noted in point 2, this can be a problem for editors who are not familiar with the default language. They would certainly like to be able to change the language of the page tree to a different source language.
Possible Solution
In Short
Rethink about the default language as a pure structure provider, that is independent of any particular language and is generated automatically in the background while editing particular languages.
In this way, we do not deviate too far from the current status of translation handling, since the language overlay concept can be retained and it mainly changes the type of display in the backend (hidden structural layer aka default language).
Example Structure and Graphics
In the context of pages you can imagine this as in the following graphic from Info > Localization overview:
or as a table:
Structural Layer | English (USA) | German (Germany) | Spanish (Spain) |
---|---|---|---|
[1-root] | Startpage | Startseite | Página de inicio |
[1-1_customer_portal] | Portal de clientes | ||
[1-2_retailer] | Fachhandel | ||
[1-3_service] | Service | Servicio | |
[1-4_career] | Career | ||
[1-5_business_units] | Business Units | Unidades de negocio | |
[1-6_products] | Products | Produkte | |
[1-7_company] | Company | Unternehmen | Empresa |
In the context of content you can imagine this as in the following graphic from the page module:
or as a table:
Structural Layer | English (USA) | German (Germany) | Spanish (Spain) |
---|---|---|---|
[content-1] | [content-1_es-ES] | ||
[content-2] | [content-2_de-DE] | ||
[content-3] | [content-3_de-DE] | [content-3_es-ES] | |
[content-4] | [content-4_en-US] | ||
[content-5] | [content-5_en-US] | [content-5_es-ES] | |
[content-6] | [content-6_en-US] | [content-6_de-DE] | |
[content-7] | [content-7_en-US] | [content-7_de-DE] | [content-7_es-ES] |
In both cases the structure of pages and content is clearly defined across all languages by the structural layer aka default language.
Discard the “free” mode
The free mode should be discarded then, since we are always connected with the structural layer, regardless of whether or not a record exists in the language previously defined as the default language.
Source and Target language(s)
On the one hand, an editor should be able to determine at runtime in which source language he or she would like to work. On the other hand, he or she should be able to determine into which target language(s) he or she would like to translate this source language if he or she is not currently working in column view.
Therefore a new option to select the source language in the TYPO3 backend needs to be introduced which replaces the default language column by the selected source language. The language menu, which currently already exists in the page module, can be retained for the purpose of selecting the target language.
Reduce displayed structure
Since each language can have its own structures, it can happen that the structure layer, that applies to all languages, becomes very complex.
To solve this problem the selected source language also determines the structures displayed in the backend. So only that part of the structural layer is used, that has a connection to the currently selected source language. In this way, the display can be kept clear and the focus can be placed on the language currently used and the language to be translated into.
Example 1: If we select “English (USA)” as source language and “Spanish (Spain)” as target language while using the structures shown in the grapics above the resulting page tree should look like this:
- Startpage
- Career
- Business Units
- Products
- Company
And the page module should look like this:
English (USA) Spanish (Spain) [content-4_en-US] [content-5_en-US] [content-5_es-ES] [content-6_en-US] [content-7_en-US] [content-7_es-ES]
Example 2: If we select “Spanish (Spain)” as source language and “English (USA)” as target language while using the structures shown in the grapics above the resulting page tree should look like this:
- Página de inicio
- Portal de clientes
- Servicio
- Unidades de negocio
- Empresa
And the page module should look like this:
English (USA) Spanish (Spain) [content-1_es-ES] [content-3_es-ES] [content-5_es-ES] [content-5_en-US] [content-7_es-ES] [content-7_en-US]
Side aspects that need decisions
Different sorting across languages?
As the participants of the session noted, it can happen that content should be connected to the same structure element across several languages, but should still be sorted differently from language to language. Here it has to be considered whether in such cases the connection to separate structural elements is necessary or whether there is a way how this deviation can be taken into account within a specific language.
Translation of the page tree as separate task?
One participant noted that translating the page tree based on the structure-layer concept could be considered a separate task. Implementation at page level will probably be easier to implement than at content element level.
New Database tables to provide the structural layer?
Since the structure layer requires far fewer fields than the actual pages and content elements of a specific language, one might consider moving these to separate tables to streamline processing.
What’s next?
Thank you for taking the time to engage with my thoughts. I would be very happy if you would let me know what you think about it.
- Have I overlooked aspects of how translations are handled?
- What do you think of the basic idea?
- Is there something that you would solve differently or do you have completely different ideas about it?
- How do you deal with the mentioned editorial problems?
Thanks in advance for your feedback.