Skip to content

Commit c5320d8

Browse files
github-actions[bot]brotkruemllinawolf
authored
[Backport 12.4] [TASK] Revise localized content chapter (#98)
Releases: main, 12.4, 11.5 --------- Co-authored-by: Chris Müller <2566282+brotkrueml@users.noreply.github.com> Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com>
1 parent 6429e5d commit c5320d8

2 files changed

Lines changed: 119 additions & 103 deletions

File tree

-47.5 KB
Loading
Lines changed: 119 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,191 @@
1-
.. include:: /Includes.rst.txt
1+
.. include:: /Includes.rst.txt
22

3+
.. _localized-content:
34

4-
.. _localized-content:
5-
5+
=================
66
Localized content
7-
-----------------
8-
9-
There are two strategies for handling the translation of content on pages:
10-
11-
- **Connected mode:** Translating content will create a direct connection between the original
12-
language and the language you translate to. This means that moving an
13-
element or setting meta information like start- or endtime will be taken
14-
from the original content and you will not be able to set these values
15-
on a translated content element. Translated records will hold the
16-
connection to their original language record in the "l10n_parent" field.
17-
This mode is best for a strict translation workflow.
18-
19-
- **Free mode:** Copying content will take the content elements from the source language
20-
and create copies in a different language. This means that you will be able
21-
to move content elements around freely, but you will not have the benefit of
22-
being able to compare changes made in the source language later on.
23-
Use this mode, when the translated pages content can largely differ from
24-
the original language and you want to have that freedom in designing your
25-
translated website.
7+
=================
268

27-
When you start translating a page, the **WEB > Page** module will
28-
ask you about this choice.
9+
.. contents::
10+
:local:
2911

30-
.. figure:: /Images/ManualScreenshots/PageModule/LocalizedContentTranslationWizard.png
31-
:alt: The translation wizard showing localization strategies
3212

33-
The translation wizard asks for a choice of localization strategy
13+
Introduction
14+
============
3415

16+
There are two strategies for handling the translation of content on pages:
3517

36-
The "Translate" button corresponds to the connected mode, the "Copy"
37-
button to the free mode. Furthers details on how to proceed with
18+
Connected mode
19+
Translating content will create a direct connection between the original
20+
language and the language you translate to. This means that moving an
21+
element or setting meta information like start time or end time will be
22+
taken from the original content and you will not be able to set these values
23+
on a translated content element. Translated records will hold the connection
24+
to their original language record in the :sql:`l10n_parent` field.
25+
This mode is best for a strict translation workflow.
26+
27+
Free mode
28+
Copying content will take the content elements from the source language
29+
and create copies in a different language. This means that you will be able
30+
to move content elements around freely, but you will not have the benefit of
31+
being able to compare changes made in the source language later on.
32+
Use this mode, when the translated pages content can largely differ from
33+
the original language and you want to have that freedom in designing your
34+
translated website.
35+
36+
When you start translating a page, the :guilabel:`Web > Page` module will ask
37+
you about this choice when clicking on the :guilabel:`Translate` button:
38+
39+
.. figure:: /Images/ManualScreenshots/PageModule/LocalizedContentTranslationWizard.png
40+
:alt: The translation wizard showing localization strategies
41+
:class: with-shadow
42+
43+
The translation wizard asks for a choice of localization strategy
44+
45+
The :guilabel:`Translate` button corresponds to the connected mode, the
46+
:guilabel:`Copy` button to the free mode. Furthers details on how to proceed with
3847
translations are found in the :ref:`Editor's Tutorial <t3editors:languages>`.
3948

4049

41-
.. _localized-connected-content:
50+
.. _localized-connected-content:
4251

4352
Connected content
44-
"""""""""""""""""
53+
=================
4554

4655
If you opted for the connected content strategy, this is the default way
4756
that translated pages will be handled in the frontend and requires
48-
no further configuration in the site config.
49-
In the site config, the fallbackType "strict" would look like this:
57+
no further configuration in the :ref:`site configuration <t3coreapi:sitehandling>`.
58+
In the site configuration, the fallbackType "strict" would look like this:
5059

51-
.. code-block:: yaml
52-
:caption: config/sites/my_site/config.yaml
60+
.. code-block:: yaml
61+
:caption: config/sites/my_site/config.yaml
5362
54-
languages:
55-
-
56-
# ... other language settings ...
57-
fallbackType: strict
63+
languages:
64+
-
65+
# ... other language settings ...
66+
fallbackType: strict
5867
5968
In this connected mode, TYPO3 will first internally fetch the records of the
6069
default language, then overlay them with the target language. If a record is
61-
not translated into the target language, then it is discarded and not shown at all.
70+
not translated into the target language, then it is discarded and not shown at
71+
all.
6272

6373
The German version will be reduced to the actually translated elements:
6474

65-
.. figure:: /Images/ManualScreenshots/Frontend/LocalizedContentNoOverlay.png
66-
:alt: English and German translation without overlays
67-
:class: with-border with-shadow
68-
75+
.. figure:: /Images/ManualScreenshots/Frontend/LocalizedContentNoOverlay.png
76+
:alt: English and German translation without overlays
77+
:class: with-shadow
6978

79+
English and German translation without overlays
7080

71-
Another way to view "connected" content in the frontend is by creating a fallback
72-
chain. For this we have to adjust the site configuration and provide a comma separated
73-
list of fallback languages:
81+
Another way to view connected content in the frontend is by creating a fallback
82+
chain. For this we have to adjust the site configuration and provide a
83+
comma-separated list of fallback languages:
7484

75-
.. code-block:: yaml
76-
:caption: config/sites/my_site/config.yaml
85+
.. code-block:: yaml
86+
:caption: config/sites/my_site/config.yaml
7787
78-
languages:
79-
-
80-
# ... other language settings ...
81-
fallbackType: fallback
82-
# 1 = Danish, 0 = English
83-
fallbacks: '1,0'
88+
languages:
89+
-
90+
# ... other language settings ...
91+
fallbackType: fallback
92+
# 1 = Danish, 0 = English
93+
fallbacks: '1,0'
8494
8595
In this mode, TYPO3 will also first internally fetch the records of the
8696
default language and then overlay them with the target language. If no translation
8797
exists for the target language, it will now go from left to right through the
88-
fallback chain and first try to find a translation for the languageId 1 (Danish) and
89-
if that is a miss as well, fall back to languageId 0 (English).
90-
91-
.. figure:: /Images/ManualScreenshots/Frontend/LocalizedContentTranslationOverlay.png
92-
:alt: English and German translation with overlays
93-
:class: with-border with-shadow
98+
fallback chain and first try to find a translation for the language ID 1 (Danish)
99+
and, if that is a miss as well, fall back to language ID 0 (English).
94100

95-
The English version and its German translation, with overlays
101+
.. figure:: /Images/ManualScreenshots/Frontend/LocalizedContentTranslationOverlay.png
102+
:alt: English and German translation with overlays
103+
:class: with-shadow
96104

97-
.. warning::
105+
The English version and its German translation, with overlays
98106

99-
If you want to use the "connected content" paradigm in conjunction with the
100-
:ref:`"Hide default translation of the page" <localization-overview-hide-default-language>`
101-
setting, you will need to provide placeholder content elements
102-
in the default language and translate them, since the whole frontend
103-
rendering process starts from the default language in such a configuration.
107+
.. warning::
108+
If you want to use the "connected content" paradigm in conjunction with the
109+
:ref:`"Hide default translation of the page" <localization-overview-hide-default-language>`
110+
setting, you will need to provide placeholder content elements
111+
in the default language and translate them, since the whole frontend
112+
rendering process starts from the default language in such a configuration.
104113

105-
.. _localized-content-free-content:
114+
.. _localized-content-free-content:
106115

107116
Free content
108-
""""""""""""
117+
============
109118

110-
With the free mode content strategy, the site config will have to be
119+
With the free mode content strategy, the
120+
:ref:`site configuration <t3coreapi:sitehandling>` will have to be
111121
adjusted accordingly:
112122

113-
.. code-block:: yaml
114-
:caption: config/sites/my_site/config.yaml
123+
.. code-block:: yaml
124+
:caption: config/sites/my_site/config.yaml
115125
116-
languages:
117-
-
118-
# ... other language settings ...
119-
fallbackType: free
126+
languages:
127+
-
128+
# ... other language settings ...
129+
fallbackType: free
120130
121131
This means, TYPO3 will directly fetch the translated records and not care
122132
about the records in the default language at all.
123133

124-
.. tip::
134+
.. tip::
125135
For more information on how to add languages and configure their
126-
behaviour in the site configuration, please see
127-
:ref:`Adding Languages <sitehandling-addinglanguages>`
136+
behaviour in the site configuration, see
137+
:ref:`Adding Languages <sitehandling-addinglanguages>`.
128138

129139

130-
.. _localized-content-all-language:
140+
.. _localized-content-all-language:
131141

132142
The "All" language
133-
""""""""""""""""""
143+
==================
134144

135145
When using overlays, it becomes possible to use a particular
136146
language called "All", which will be automatically visible across all
137147
translations. The uid of that particular language is "-1".
138148

139-
.. figure:: /Images/ManualScreenshots/Record/LocalizedContentAllLanguageDefined.png
140-
:alt: Content element in "All" language
149+
.. figure:: /Images/ManualScreenshots/Record/LocalizedContentAllLanguageDefined.png
150+
:alt: Content element in "All" language
151+
:class: with-shadow
141152

142-
A content element valid for all languages
153+
A content element valid for all languages
143154

144-
It is also marked with the special language icon in the **WEB > Page**
155+
It is also marked with the special language icon in the :guilabel:`Web > Page`
145156
module:
146157

147-
.. figure:: /Images/ManualScreenshots/PageModule/LocalizedContentAllLanguagePageModule.png
148-
:alt: "All" language in the Page Module
158+
.. figure:: /Images/ManualScreenshots/PageModule/LocalizedContentAllLanguagePageModule.png
159+
:alt: "All" language in the Page Module
160+
:class: with-shadow
149161

150-
An "All" language content element displayed in the Web > Page
162+
An "All" language content element displayed in the :guilabel:`Web > Page` module
151163

152-
Note that no "Translate" button appears, the new content element
164+
Note that no :guilabel:`Translate` button appears, the new content element
153165
is valid for all languages.
154166

155167

156-
.. _localized-content-inline-elements:
168+
.. _localized-content-inline-elements:
157169

158170
Localizing inline elements (IRRE)
159-
"""""""""""""""""""""""""""""""""
171+
=================================
160172

161-
When localizing a record with inline elements (aka. IRRE), the inline
162-
elements will be grayed out and not automatically localized. TYPO3
173+
When localizing a record with :ref:`inline elements (IRRE) <columns-inline>`,
174+
the inline elements will be grayed out and not automatically localized. TYPO3
163175
will display two buttons to help you localize and keep the elements in
164176
sync.
165177

166-
.. figure:: ../Images/LocalizedContentLocalizingIrreElements.png
167-
:alt: Buttons for localizing and synchronizing inline elements.
178+
.. figure:: ../Images/LocalizedContentLocalizingIrreElements.png
179+
:alt: Buttons for localizing and synchronizing inline elements
180+
:class: with-shadow
181+
182+
Buttons for localizing and synchronizing inline elements
183+
184+
**Localize all records (1)** creates localized versions of all inline
185+
elements from the default language in your current language so that
186+
you can translate them. Each element that has not yet been localized
187+
will also have a :guilabel:`Localize` button (3) that will allow you to localize
188+
individual elements.
168189

169-
* **Localize all records (1)** creates localized versions of all inline
170-
elements from the default language in your current language so that
171-
you can translate them. Each element that has not yet been localized
172-
will also have a "Localize" button (3) that will allow you to localize
173-
individual elements.
174-
* **Synchronize with original language (2)** can be clicked when you have
175-
translated the elements and the content in the default language changed.
190+
**Synchronize with original language (2)** can be clicked when you have
191+
translated the elements and the content in the default language changed.

0 commit comments

Comments
 (0)