TYPO3 translate to NOT current language

北慕城南 提交于 2019-12-24 05:14:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!