Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve translation extraction on custom validators #59272

Copy link
Copy link
Open
@KDederichs

Description

@KDederichs
Issue body actions

Description

I've been having this issue where I got constraint validators that just do one very specific thing so it doesn't make sense for them to have a variable message attribute.
Sadly that means the translation extract will not pick up on things that need to be translated in those validators.

It would be great if the translation extract could also look at all validators by default and extract hard coded stings out of those.

Example

For example I got this violation:

        $this->context
            ->buildViolation('Currencies do not match. User currency is {userCurrency}, target currency is {valueCurrency}', ['{userCurrency}' => $userMoney->getCurrency(), '{valueCurrency}' => $valueMoney->getCurrency()])
            ->setTranslationDomain('app_validators');

but the extractor isn't picking up on it requiring me to go through all of them and extract them by hand.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.