http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692019-03-03T18:54:50ZTYPO3 ForgeTYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=3959772019-03-03T18:54:50ZRiccardo De Contardierredeco@gmail.com
<ul><li><strong>Category</strong> set to <i>Localization</i></li></ul> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4024092019-06-26T22:12:46ZRiccardo De Contardierredeco@gmail.com
<ul></ul><p>I have performed the following test with TYPO3 9.5.8</p>
<a name="Prerequisites"></a>
<h2 >Prerequisites<a href="#Prerequisites" class="wiki-anchor">¶</a></h2>
<p>- fresh TYPO3 9.5.8 installation<br />- configuration with three languages: ITALIAN (main); ENGLISH (Id=1), FRENCH (Id=2); this is the config.yaml part about the language configuration:</p>
<pre>
languages:
-
title: Italian
enabled: true
languageId: '0'
base: /
typo3Language: it
locale: it_IT.UTF-8
iso-639-1: it
navigationTitle: Italiano
hreflang: it-IT
direction: ltr
flag: it
-
title: English
enabled: true
languageId: '1'
base: /en/
typo3Language: default
locale: en_EN.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-EN
direction: ''
fallbackType: fallback
fallbacks: '0'
flag: gb
-
title: French
enabled: true
languageId: '2'
base: /fr/
typo3Language: fr
locale: fr_FR.UTF-8
iso-639-1: fr
navigationTitle: French
hreflang: fr-FR
direction: ''
fallbackType: fallback
fallbacks: '1'
flag: fr
</pre>
<a name="Test-execution"></a>
<h2 >Test execution:<a href="#Test-execution" class="wiki-anchor">¶</a></h2>
<p>1) I created three language files:</p>
<p><strong>fileadmin/loccallang.xlf</strong><br /><pre>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" product-name="test" date="2019-06-26T22:00:00+02:00">
<header/>
<body>
<trans-unit id="test">
<source>Test ENG</source>
</trans-unit>
</body>
</file>
</xliff>
</pre></p>
<p><strong>fileadmin/it.locallang.xlf</strong><br /><pre>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" product-name="test" date="2019-06-26T22:00:00+02:00">
<header/>
<body>
<trans-unit id="test">
<source>Test ENG</source>
<target>Test ITA</target>
</trans-unit>
</body>
</file>
</xliff>
</pre><br /><strong>fileadmin/fr.locallang.xlf</strong><br /><pre>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" product-name="test" date="2019-06-26T22:00:00+02:00">
<header/>
<body>
<trans-unit id="test">
<source>Test ENG</source>
<target>Test FRA</target>
</trans-unit>
</body>
</file>
</xliff>
</pre></p>
<p>2) TS Template: added:</p>
<pre>
page.inlineLanguageLabelFiles {
someLabels = fileadmin/locallang.xlf
someLabels.errorMode = 0
}
</pre>
<a name="Test-results"></a>
<h2 >Test results:<a href="#Test-results" class="wiki-anchor">¶</a></h2>
<p>- source code of <a class="external" href="https://mysite.com">https://mysite.com</a> (italian) contains:</p>
<pre>
<script type="text/javascript">
/*<![CDATA[*/
var TYPO3 = TYPO3 || {};
TYPO3.lang = {"test":"Test ITA"};/*]]>*/
</script>
</pre>
<p>- source code of <a class="external" href="https://mysite.com/en">https://mysite.com/en</a> (english) contains:</p>
<pre>
<script type="text/javascript">
/*<![CDATA[*/
var TYPO3 = TYPO3 || {};
TYPO3.lang = {"test":"Test ENG"};/*]]>*/
</script>
</pre>
<p>- source code of <a class="external" href="https://mysite.com/fr">https://mysite.com/fr</a> (french) contains:</p>
<pre>
<script type="text/javascript">
/*<![CDATA[*/
var TYPO3 = TYPO3 || {};
TYPO3.lang = {"test":"Test FRA"};/*]]>*/
</script>
</pre>
<p>Is this the expected result?</p> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4035352019-07-23T09:59:44ZJustus Moronideveloper@leonmrni.com
<ul></ul><p>Your example would be what i expect when using this feature.</p>
<p>It seems that something changed here between 8.7 and 9.5.</p>
<p>My TYPO3.lang contains the following:<br /><pre><code class="javascript syntaxhl" data-language="javascript"><span class="nx">TYPO3</span><span class="p">.</span><span class="nx">lang</span> <span class="o">=</span> <span class="p">{</span>
<span class="dl">"</span><span class="s2">foo</span><span class="dl">"</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="dl">"</span><span class="s2">source</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">foo</span><span class="dl">"</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">target</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">bar</span><span class="dl">"</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">};</span>
</code></pre></p>
<p>I will check this again in the project and will compare it with 9.5.</p> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4039362019-07-26T15:45:33ZJustus Moronideveloper@leonmrni.com
<ul></ul><p>Okay - i've tested this in 9.5 LTS.</p>
<p>I've realized that i forgot to mention that my <em>locallang.xlf</em> file is german.<br />And i have a <em>en.locallang.xlf</em> for the second language.</p>
<p>When i switch the languages in the <em>locallang.xlf</em> files - it works as you've described.</p>
<hr />
<p>Is it "Best Practice" or somewhere mentioned that the default <em>locallang.xlf</em> should always be english?</p>
<p>Until now i've always used the default language of the website as the default language of the <em>locallang.xlf</em> file.</p>
<p>My scenario was that a website started with one language <em>german</em> and then a second language <em>english</em> was added.<br />In that case i did not switch the language files. The default <em>locallang.xlf</em> still containted the german translations.</p>
<p>I've never had any issues with this setup until i used the _ inlineLanguageLabelFiles_ feature in the project 11 months ago.</p> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4056702019-09-08T21:29:09ZRiccardo De Contardierredeco@gmail.com
<ul></ul><p>Hello and sorry for my late answer;</p>
<p>I find in the documentation here <a class="external" href="https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Internationalization/XliffFormat.html#basics">https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Internationalization/XliffFormat.html#basics</a></p>
<blockquote>
<p>The translated file is very similar. If the original file was named <code>locallang.xlf</code>, the translated file for German (code “de”) will be named <code>de.locallang.xlf</code>. Note that the original file must always be in english, so it is not <br />allowed to create a file with the prefix “en” e.g. <code>en.locallang.xlf</code> [...]</p>
</blockquote> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4064612019-09-24T10:32:02ZJustus Moronideveloper@leonmrni.com
<ul></ul><p>Do you think this should be enforced?</p>
<p>Like:<br />Throw an exception when a `en.locallang.xlf` file was detected.</p>
<p>This could be a deprecation in version 10 and then be removed in a later version?</p> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4193642020-03-17T15:20:18ZGeorg Ringer
<ul><li><strong>Sprint Focus</strong> set to <i>PRC</i></li></ul> TYPO3 Core - Bug #86156: CMS 8:When using inlineLanguageLabelFiles and a different default language than english, only the default language is usablehttp://forge.typo3.org/issues/86156?journal_id=4203382020-03-24T17:52:41ZBenni Mackbenni@typo3.org
<ul><li><strong>Sprint Focus</strong> changed from <i>PRC</i> to <i>Needs Decision</i></li></ul>