Project

General

Profile

Bug #104468

Updated by Hannes Lau 3 days ago

 
 We have a lot of projects where the sites are created in German and later translated to English. This is true for the site content but also for the xlf labels. So our source locallang.xlf files are in German. Translation agencies create the translation files, such as en.locallang.xlf or zh.locallang.xlf. It is way easier for them to work forward from the locallang.xlf with the source tags, then backwards (target -> source) from a translated de.locallang.xlf. 

 Up to TYPO3 12, this worked fine. We just had to register English as another translation language in ext_localconf.php.  

 <pre><code class="php"> ``` 
 // As this site uses German as the default language, register English as a translation language 
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] = ['en' => 'English']; 
 </code></pre> ``` 

 Since TYPO3 12, probably since https://review.typo3.org/c/Packages/TYPO3.CMS/+/77558 this does not work any more.  

 https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Localization/LanguageService.php#L296 has been altered:  

 <pre><code class="php"> ``` 
     private function getTypo3LanguageKey(): string 
     { 
         if ($this->locale === null) { 
             return 'default'; 
         } 
         if ($this->locale->getName() === 'en') { 
             return 'default'; 
         } 
         return $this->locale->getName(); 
     } 
 </code></pre> ``` 

 This forces our language 'en' back to 'default'. But default is German. When we remove those lines, it seems to work fine. Do we need them in the core?

Back