Feature #52481
Translations for Error Message should be easily changed
Status: | Resolved | Start date: | 2013-10-02 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 100% |
|
Category: | - | |||
Target version: | - |
Description
currently you have to copy
Packages\Application\TYPO3.Form\Resources\Private\Form\Layouts\Field.html
edit this line {error -> f:translate(id: error.code, arguments: error.arguments, package: 'TYPO3.Form', source: 'ValidationErrors')}
TYPO3.Form => <Vendor.Package>
use your own layout
TYPO3: Form: presets: default: formElementTypes: 'TYPO3.Form:Base': renderingOptions: layoutPathPattern: 'resource://<Vendor.Package>/Private/Form/Layouts/{@type}.html'
and THEN you can use your own xlf files in
Packages\Sites\<Vendor.Package>\Resources\Private\Translations\<language>\ValidationErrors.xlf
a simpler approach would be nice. Maybe just introduce a setting that will be used within Field.html... something like
ErrorTranslationPackage: 'TYPO3.Form'
Associated revisions
[!!!][FEATURE] Configurable Translation-Package
This change makes it possible to easily change the package that is
used to load ValidationError-messages from. This has been cumbersome
before.
By default, error messages will now be loaded from TYPO3.Flow (file
``Resources/Private/Translations/en/ValidationErrors.xlf``), but this
can be changed by setting the new ``translationPackage`` rendering
option::
TYPO3:
Form:
presets:
'somePresetName':
formElementTypes:
'TYPO3.Form:Base':
renderingOptions:
translationPackage: 'Some.OtherPackage'
This can even be changed for single FormElements now.
This change is breaking if you have a custom Field.html layout, you need
to make sure::
package: '{element.renderingOptions.translationPackage}'
is used there for the ``f:translate`` call.
Change-Id: Ib1c9e73ed09f16968b7058de8f889abca2501144
Resolves: #52481
History
#1 Updated by Bastian Waidelich almost 2 years ago
- Status changed from New to Accepted
- Assigned To set to Bastian Waidelich
#2 Updated by Gerrit Code Review almost 2 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24931
#3 Updated by Gerrit Code Review almost 2 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24931
#4 Updated by Gerrit Code Review almost 2 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24931
#5 Updated by Bastian Waidelich almost 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d8d96b3af0ff21c23d7df2d6e985f32dd5ab3b73.