问题
I have typo3 extension with template:
{namespace v=Tx_Vhs_ViewHelpers}
<f:translate id="LLL:typo3conf/ext/my_ext/Resources/Private/Language/fr.locallang.xlf:labelTerms" />
<f:translate id="LLL:typo3conf/ext/my_ext/Resources/Private/Language/it.locallang.xlf:labelTerms" />
If current language is French, first label translated to French, but second displays in English (default). When I switch current language to Italian, second label displays in Italian but first displays in English
How can I use two or more languages in same time on one page?
Thank you in advance.
回答1:
Basically, you can not use 2 languages in the same time on a page. TYPO3 will always use the current language and give you exactly what you asked for.
What you can do is render the 'translations' outside the TYPO3 translation scope, meaning that you can, for ex, use another source of your translated terms that are not treated by typo3 translation (can be an array somewhere , etc ...)
Or implement the translations of the other languages in the xlif itself for specific languages. Make the translation of the fr, it etc .. terms to be available in the other languages also.
<f:translate id="LLL:typo3conf/ext/my_ext/Resources/Private/Language/fr.locallang.xlf:labelTerms.ItVersion" />
<f:translate id="LLL:typo3conf/ext/my_ext/Resources/Private/Language/fr.locallang.xlf:labelTerms.FrVersion" />
来源:https://stackoverflow.com/questions/31045839/typo3-translate-to-not-current-language