Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.83 KB

File metadata and controls

55 lines (36 loc) · 1.83 KB

Back to Index / back to README


Translation logic for cropVariant label

When you define a new cropVariant with \JosefGlatz\CropVariantsBuilder\CropVariant::create() the passed parameter is used as the cropVariant name.

The given name is also used to retrieve a meaningful label (and translation) for the TYPO3 backend automatically.

We use the cropVariant name md in the following example (\JosefGlatz\CropVariantsBuilder\CropVariant::create('md')).

Either the supplied XLF file is used or the XLF file in the configured extension is used depending on your extension configuration settings of ext:cropvariantsbuilder.

If you set the proper extension configuration

A label LLL:EXT:yourconfiguredExtensionName/Resources/Private/Language/locallang.xlf:crop_variants.md.label is used as final string.

Make sure to add the proper translation string to the xlf file!

If you do not set the proper extension configuration

A label LLL:EXT:cropvariantsbuilder/Resources/Private/Language/locallang.xlf:crop_variants.md.label is used as final string.

This returns the label "Medium (md) ⇡". This extension ships a label for that.

As you can see, everytime you can not rely on the shipped translation strings of ext:cropvariants!

Overwrite label with a custom content

If you do not want to use XLF files for translating labels at all or you want to set a custom LLL:EXT:whateverforthislabel/... label then you can use the method setTitle() of the CropVariant class.


Available defaults

Please see shipped locallang.xlf for details. If you need more common labels, please provide a pull request or create an issue!