sitegeist / fluid-components

Encapsulated frontend components with Fluid's ViewHelper syntax for TYPO3
https://fluidcomponents.sitegeist.de/
GNU General Public License v2.0
51 stars 21 forks source link

Option 'arguments' for translations #160

Open KPeschke opened 3 weeks ago

KPeschke commented 3 weeks ago

I'm missing the option to pass arguments for the translations (component parameter 'labels') of the Translate view helper .

Can you please add this to the translations? Thank you very much!

KPeschke commented 3 weeks ago

Oh, I have found a workaround. It is not necessary to adapt your code, but a note in the documentation would be great.

e.g. in your *.labels.xlf

<trans-unit id="your_label_name" xml:space="preserve">
  <source><![CDATA[%s item(s)]]></source>
  <target><![CDATA[%s Item(s)]]></target>
</trans-unit>

in your component

<fc:param optional="1" name="labels" type="Labels"/>

<f:variable name="your_label_name"><f:spaceless>
    <f:replace value="{labels.your_label_name}" search="%s" replace="{itemCount}"/>
</f:spaceless></f:variable>