Bug #82853
closedCannot translate field options by type
100%
Description
The translation chain for field options (e.g. for SingleSelect
) can only be translated a) by form identifier + field identifier or b) by field identifier. Other properties also include c) by field type.
This should be added.
Files
Updated by Gerrit Code Review about 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54472
Updated by Pawel Cieslik about 7 years ago
Please add proper reproduction instructions. How to define the translation file, etc. thanks (eg. links to docs or so)
Updated by Mathias Brodala about 7 years ago
Here's our usecase: we wanted to re-use the label and option labels of a select field, so we added a custom prototype which extends SingleSelect
:
TYPO3: CMS: Form: prototypes: standard: formEngine: translationFile: - EXT:form/Resources/Private/Language/Database.xlf - EXT:foo/Resources/Private/Language/Extensions/Form/locallang_db.xlf formElementsDefinition: CustomSelect: __inheritances: 10: 'TYPO3.CMS.Form.prototypes.standard.formElementsDefinition.SingleSelect' renderingOptions: templateName: SingleSelect
Now we use this prototype multiple times in our form definition:
# ... renderables: page: identifier: default type: Page renderables: - &custom identifier: custom1 type: CustomSelect label: Custom select label properties: options: 1: First 2: Second - <<: *custom identifier: custom2
Now we use the following e.g. in the EXT:foo/Resources/Private/Language/Extensions/Form/de.locallang_db.xlf
file:
<!-- ... --> <trans-unit id="element.CustomSelect.properties.label"> <source>Custom select label</source> <target>Eigenes Auswahl-Label</target> </trans-unit> <trans-unit id="element.CustomSelect.properties.options.1"> <source>First</source> <target>Erstes</target> </trans-unit> <trans-unit id="element.CustomSelect.properties.options.2"> <source>Second</source> <target>Zweites</target> </trans-unit> <!-- ... -->
Without this change, we'd need to provide translation for every single field identifier.
Updated by Pawel Cieslik about 7 years ago
- File foo.tar.xz foo.tar.xz added
in the attachment working example for introduction package
Updated by Gerrit Code Review about 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54950
Updated by Mathias Brodala about 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset af5a77829039115e997b401cd7cb30f922b64f33.