Bug #84471
closedPerform the translation key look-up as it was before #81775
100%
Description
Form elements can be translated through XLF files.
The look-up process searches for translation keys in all given translation files based on the following order:
<formDefinitionIdentifier>.element.<elementIdentifier>.properties.<propertyName> element.<formElementIdentifier>.properties.<propertyName> element.<elementType>.properties.<propertyName>
Read more: https://docs.typo3.org/typo3cms/extensions/form/Concepts/FrontendRendering/Index.html#translation
If a form is rendered through the "form" content element, the identifier of the form is modified with a suffix.
The form identifier will be suffixed with "-$contentElementUid" (e.g. "testForm-65").
This rules since #81775
Before #81775, the translation key look-up for a form definition with the identifier 'testForm' and a form element with identifier 'text-1' for the property 'label' was
testForm.element.text-1.properties.label element.text-1.properties.label element.Text.properties.label
After #81775 it is (if the form is rendered through the "form" content element and the content element has the uid 1)
testForm-1.element.text-1.properties.label element.text-1.properties.label element.Text.properties.label
There is no search for the key 'testForm.element.text-1.properties.label'.
Even if #81775 is marked as breaking, this issue should be treated.
Updated by Gerrit Code Review over 6 years ago
- Status changed from Accepted 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/56356
Updated by Ralf Zimmermann over 6 years ago
Test it:
Create a new form with this definition:
type: Form identifier: testForm label: test prototypeName: standard renderables: - type: Page identifier: page-1 label: Step renderables: - defaultValue: '' type: Text identifier: text-1 label: Text
and create a new form content element and select this form.
Open EXT:form/Resources/Private/Language/locallang.xlf and put
<trans-unit id="testForm.element.text-1.properties.label" xml:space="preserve"> <source>Visible with the Patch</source> </trans-unit> <trans-unit id="testForm-1.element.text-1.properties.label" xml:space="preserve"> <source>Visible without the Patch (and with the patch if 'testForm.element.text-1.properties.label' is not defined)</source> </trans-unit>
into it.
You must replace 'testForm-1' with 'testForm-<contentElementUid>'.
Updated by Ralf Zimmermann over 6 years ago
- Related to Feature #81775: EXT:form - add the possibilty to use the same form multiple times on one page added
Updated by Gerrit Code Review over 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56356
Updated by Gerrit Code Review over 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56356
Updated by Gerrit Code Review over 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56356
Updated by Ralf Zimmermann over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5df2d9ab1218e8b7834143fe3204c82e38928822.