Project

General

Profile

Actions

Feature #102326

open

Allow custom translation keys for extbase validators

Added by Torben Hansen 6 months ago. Updated 6 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2023-11-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Extbase validators do currently use hardcoded translation keys to output possible validation messages. Those translation keys can globally be overwritten using a custom localization file, but it is not possible to provide individual translation keys for validation errors in a given context (e.g. property or dedicated validator call).

There is a workaround (https://stackoverflow.com/a/40400270/1744743) out there, which uses fluid and the given error codes of the extbase validators. This works fine, but I think extbase should provide something out of the box in order to define translation keys in code as shown below:

    #[Validate([
        'validator' => 'NotEmpty',
        'options' => [
            'nullTranslateKey' => 'validation.title.notNull',
            'emptyTranslateKey' => 'validation.title.notEmpty',
            'extensionName' => 'my_extension'
        ],
    ])]
    protected string $title = '';
Actions #1

Updated by Torben Hansen 6 months ago

  • Subject changed from Allow custom translation keys or extbase validators to Allow custom translation keys for extbase validators
Actions #2

Updated by Torben Hansen 6 months ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #4

Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #5

Updated by Torben Hansen 6 months ago

  • Description updated (diff)
Actions #6

Updated by Gerrit Code Review 6 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #7

Updated by Gerrit Code Review 6 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #8

Updated by Gerrit Code Review 6 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #9

Updated by Gerrit Code Review 6 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #10

Updated by Gerrit Code Review 6 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #11

Updated by Gerrit Code Review 6 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #12

Updated by Gerrit Code Review 5 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #13

Updated by Gerrit Code Review 4 months ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #14

Updated by Gerrit Code Review 3 months ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #15

Updated by Gerrit Code Review 3 months ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #16

Updated by Gerrit Code Review 3 months ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #17

Updated by Benni Mack 3 months ago

  • Target version changed from 13.0 to 13.1
Actions #18

Updated by Gerrit Code Review 2 months ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #19

Updated by Gerrit Code Review 2 months ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #20

Updated by Gerrit Code Review 2 months ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #21

Updated by Gerrit Code Review about 1 month ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #22

Updated by Gerrit Code Review about 1 month ago

Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #23

Updated by Gerrit Code Review 27 days ago

Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #24

Updated by Gerrit Code Review 12 days ago

Patch set 20 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81696

Actions #25

Updated by Benni Mack 6 days ago

  • Target version changed from 13.1 to 13.2
Actions

Also available in: Atom PDF