Bug #82853

Cannot translate field options by type

Added by Mathias Brodala almost 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
Start date:
2017-10-25
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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.

foo.tar.xz (1.43 KB) Pawel Cieslik, 2017-11-28 15:40

Associated revisions

Revision af5a7782 (diff)
Added by Mathias Brodala almost 2 years ago

[BUGFIX] EXT:form - allow field options translation by type

Resolves: #82853
Releases: master, 8.7
Change-Id: I7d55cb7a6472d310b2f1d47a9b04014cbd43a832
Reviewed-on: https://review.typo3.org/54472
Tested-by: TYPO3com <>
Reviewed-by: Daniel Lorenz <>
Tested-by: Daniel Lorenz <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: Henning Liebe <>
Reviewed-by: Pawel Cieslik <>
Tested-by: Pawel Cieslik <>
Reviewed-by: Bjoern Jacob <>
Tested-by: Bjoern Jacob <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision 53e4f56a (diff)
Added by Mathias Brodala almost 2 years ago

[BUGFIX] EXT:form - allow field options translation by type

Resolves: #82853
Releases: master, 8.7
Change-Id: I7d55cb7a6472d310b2f1d47a9b04014cbd43a832
Reviewed-on: https://review.typo3.org/54950
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

History

#1 Updated by Gerrit Code Review almost 2 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

#2 Updated by Pawel Cieslik almost 2 years ago

Please add proper reproduction instructions. How to define the translation file, etc. thanks (eg. links to docs or so)

#3 Updated by Mathias Brodala almost 2 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.

#4 Updated by Pawel Cieslik almost 2 years ago

in the attachment working example for introduction package

#5 Updated by Gerrit Code Review almost 2 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

#6 Updated by Mathias Brodala almost 2 years ago

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

#7 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF