'How to implement multilingual labels in tx:mask (TYPO3)?

I would like implement multilingual labels in TYPO3 mask. After implementing with the following FLUID-code the label does not change based on the chosen language:

<f:link.page pageUid="{data.tx_mask_inhalt_text_link}">
<f:if condition="{TSFE.sys_language_uid} == 1">
    <f:then>
         enter code here`Read more
    </f:then>
    <f:else>
         Weiterlesen
    </f:else>
</f:if>

</f:link.page>



Solution 1:[1]

You can use XLIFF files to localize values in TYPO3. This is neither limited to nor different for mask templates (as these are common Fluid templates).

A locallang.xlf contains entries like:

<trans-unit id="readmore">
    <source>Read more</source>
    <target>weiterlesen</target>
</trans-unit>

In the HTML template you can use the f:translate viewhelper:

<f:translate key="LLL:EXT:your_extension/Resources/Private/Language/locallang.xlf:readmore" />

This will render the value depending on the current frontend language.


This is the usual way of translating in TYPO3. Please refer to these official documentations for all details:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1