Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations are not applied for validators #26

Closed
geekdevs opened this issue Sep 18, 2017 · 1 comment
Closed

Translations are not applied for validators #26

geekdevs opened this issue Sep 18, 2017 · 1 comment
Labels
Milestone

Comments

@geekdevs
Copy link
Contributor

Translations do not apply for validation messages.
Although I see translations from this bundle are added to the admin, e.g. "members.validation.email.already_used" it's not applied during form validation.

For example registration form has IsUniqueEmail constraint which has default message email_already_used instead of members.validation.email.already_used.

But even if I update it to be "members.validation.email.already_used" it still won't translate because pimcore is only using "messages" translation domain for translations and symfony sets "validators" translation domain for constrain violations.

I managed to solve it by forcing pimcore use "messages" domain always:

parameters:
    validator.translation_domain: 'messages'

But I was wondering if you had better solution in mind and that's just a minor issue?

@solverat solverat added this to the 2.0.0 milestone Sep 19, 2017
@solverat solverat added the bug label Sep 19, 2017
@solverat
Copy link
Member

Hey @geekdevs, thanks for your investigation. Actually, we need to set the validator translation domain by ourself, since symfony requires an explicit translation domain for validation messages. So your solution is perfectly ok. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants