Bug #74380
closedTypoScript interpret XLF wrong for Default-Language (german) and english
0%
Description
System:
- TYPO3 7.6.4
- default language German
- misleading language in language-Switcher
Bug
The engish (not default/main language of the website) translations are taken from the en.locallang.xlf-file within the <source>-Tags
The german translation (main-language in the website) are taken from de.locallang.xlf within the tags <target>.
Expected
The engish translations are taken from the en.locallan.xlf-file within the <target>-Tags
The german translation are taken from locallang.xlf within the <source>.
The german translation should be ignored in de.locallang.xlf.
or Expected
The engish translations are taken from the en.locallan.xlf-file within the <target>-tag
The german translation are taken from de.locallang.xlf within the <target>-tag.
The translation-file locallang.xlf should be evrytime ignored, if a localised XLF-file exists.
Code-Definitions
langugae typoscript-configuration #defaultblock for language-aspects config { # = = Default sys_language_uid = 0 locale_all = de_DE language = de htmlTag_langKey = de } lib.language.meta = TEXT lib.language.meta.value = <meta name="content-language" content="deutsch,de" /> # marker of the active language (key in the lib.languages ) lib.language.active < lib.languages.german [globalString = GP:L={$skeleton.config.language.de}] config { sys_language_uid = {$skeleton.config.language.de} locale_all = de_DE language = de htmlTag_langKey = de } lib.language.meta.value = <meta name="content-language" content="de" /> lib.language.active < lib.languages.german [global] [globalString = GP:L={$skeleton.config.language.en}] config { sys_language_uid = {$skeleton.config.language.en} sys_language_mode = fallback; {$skeleton.config.language.en},0 locale_all = en_GB language = en htmlTag_langKey = en } lib.language.meta = TEXT lib.language.meta.value = <meta name="content-language" content="en" /> lib.language.active < lib.languages.english [global] ...
Language-file Structure: locallang.xlf
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="de" target-language="de" datatype="plaintext" original="messages" date="2016-01-25T08:12:53Z" product-name="skeleton"> <header/> <body> <trans-unit id="tx_skeleton.menu.title"> <target>[DE]Menü</target> <source>[sourDE]Menü</source> </trans-unit> <trans-unit id="menu.language.de"> <target>[DE]Deutsch</target> <source>[sourDE]Deutsch</source> </trans-unit> …
language-file structure: de.locallang.xlf
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="de" target-language="de" datatype="plaintext" original="messages" date="2016-01-25T08:12:53Z" product-name="skeleton"> <header/> <body> <trans-unit id="tx_skeleton.menu.title"> <target>[DEDE]Menü</target> <source>Menü</source> </trans-unit> <trans-unit id="menu.language.de"> <target>[DEDE]Deutsch</target> <source>Deutsch</source> </trans-unit> ...
Language-file Structure: en.locallang.xlf
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <xliff version="1.0"> <file source-language="de" target-language="en" datatype="plaintext" original="messages" date="2016-01-25T08:12:53Z" product-name="skeleton"> <header/> <body> <trans-unit id="tx_skeleton.menu.title"> <target>[EN]Menü</target> <source>[sourEN]Menü</source> </trans-unit> <trans-unit id="menu.language.de"> <target>[EN]Deutsch</target> <source>[sourEN]Deutsch</source> </trans-unit> ...
TypoScript the language-switcher
## Localization menu: lib.menu.language.dropDown = HMENU lib.menu.language.dropDown { special = language special.value = 0,1,2,3,4,5,6,7 1 = GMENU 1 { NO { XY = [5.w]+4, [5.h]+4 backColor = silver 5 = IMAGE 5.file = EXT:skeleton/Resources/Public/Images/Flags/de.gif || EXT:skeleton/Resources/Public/Images/Flags/gb.gif || EXT:skeleton/Resources/Public/Images/Flags/fr.gif || EXT:skeleton/Resources/Public/Images/Flags/ru.gif|| EXT:skeleton/Resources/Public/Images/Flags/es.gif|| EXT:skeleton/Resources/Public/Images/Flags/it.gif|| EXT:skeleton/Resources/Public/Images/Flags/pl.gif|| EXT:skeleton/Resources/Public/Images/Flags/ro.gif 5.offset = 2,2 allWrap = <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.de}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.en}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.fr}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.ru}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.es}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.it}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.pl}</li> || <li>| {LLL:EXT:skeleton/Resources/Private/Language/locallang.xlf:menu.language.ro}</li> allWrap.insertData = 1 } ACT < .NO ACT = 1 ACT.noLink = 1 ACT.backColor = black } } lib.menu.language.main = COA lib.menu.language.main { 10 < lib.menu.language.dropDown wrap = <ul class="language">|</ul> }
Files
Updated by Georg Ringer over 8 years ago
- Subject changed from TypoScript interpret XLF wrong fpor Default-Language (german) and englisch to TypoScript interpret XLF wrong for Default-Language (german) and english
Updated by Klaus Hörmann-Engl about 8 years ago
I would also be interested in having German as default language, not only english. For various reasons.
Updated by Denis Mir about 8 years ago
It would be awesome if it would be possible to have a custom default language and not being forced to english.
Updated by Jana Kienast almost 8 years ago
We had the same issue with a customer's project, where German is the default language and English is the translation.
We fixed this by adjusting the LocalConfiguration.php
, we've added the following code into the SYS
section:
'localization' => [ 'locales' => [ 'user' => [ 'default' => 'German', 'en' => 'English' ] ] ]
Our locallang.xlf uses source-language="de"
, without providing a target-language
. The translation files, in this case en.locallang.xlf, contain source-language="de"
and target-language="en"
.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from New to Closed
I close this issue: according to the the official documentation:
https://docs.typo3.org/typo3cms/CoreApiReference/Internationalization/Introduction/Index.html
The "default" locallang.xlf file must always be in english; en.locallang.xlf is not allowed.
Even if one changes the behavior to make German the default language
and thus support en.locallang.xlf
, translations of the core and 3rd party extensions won't magically be converted,
so this does not seem a good path to follow.
If you think that this is the wrong decision please reopen this issue or open a new issue with a reference to this one. Thank you
Updated by Georg Ringer 5 months ago
- Related to Bug #104064: English is always taken as default xlf language added