简体   繁体   中英

TYPO3 translate to NOT current language

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.

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" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM