8000 Improve translation extraction on custom validators · Issue #59272 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Improve translation extraction on custom validators #59272
Open
@KDederichs

Description

@KDederichs

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

      0