Project

General

Profile

Actions

Bug #84471

closed

Perform the translation key look-up as it was before #81775

Added by Ralf Zimmermann over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2018-03-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #81775: EXT:form - add the possibilty to use the same form multiple times on one pageClosed2017-07-03

Actions
Actions #1

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

Actions #2

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>'.

Actions #3

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
Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

Updated by Ralf Zimmermann over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF