Skip to content

Commit 5fde618

Browse files
Update CGL: XLIFF translation domain syntax
1 parent 30a52ff commit 5fde618

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Documentation/Appendix/Cgl.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,32 @@ label reference can be separated by dots, for example:
103103
104104
Existing labels should not be mass-changed to snake case, as each changed label
105105
must be retranslated into all languages.
106+
107+
.. _appendix-cgl-xliff-domain-syntax:
108+
109+
Utilizing "translation domain syntax"
110+
-------------------------------------
111+
112+
With `Feature: #93334 - Translation Domain Mapping <https://docs.typo3.org/permalink/changelog:feature-93334-1729000000>`_
113+
and `Feature: #107759 - TranslateViewHelper supports translation domain syntax <https://docs.typo3.org/permalink/changelog:feature-107759-1729433323>`_
114+
the label localization within fluid template files and PHP code can be
115+
shortened:
116+
117+
.. code-block:: fluid
118+
119+
<f:translate key="form.legend" domain="core.messages" />
120+
<f:translate key="module.title" domain="core.module" />
121+
122+
.. code-block:: php
123+
124+
$languageService->sL('backend.toolbar:save');
125+
126+
This syntax is preferred and should be utilized for any new code committed
127+
to TYPO3 v14+ because of these reasons:
128+
129+
* It is shorter, easier to read, has no odd "LLL:EXT:" magic notation
130+
* Applies conventions of Symfony translation usage in other frameworks
131+
* Allows better automatic extraction and analysis (CLI commands)
132+
* Allows for better deprecations and usage analysis
133+
134+
Detailed reasons are found in the mentioned changelogs.

0 commit comments

Comments
 (0)