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

I18n for Bean Validation constraint messages #485

Closed
fmonorchio opened this issue Aug 17, 2022 · 4 comments · Fixed by #486
Closed

I18n for Bean Validation constraint messages #485

fmonorchio opened this issue Aug 17, 2022 · 4 comments · Fixed by #486
Assignees
Labels
info: good first issue Good for newcomers type: enhancement New feature or request

Comments

@fmonorchio
Copy link

Feature description

Hi all,

I'm trying to translate the constraint violation messages of Bean Validation in the user language. I have created a custom MessageSource with the correct property keys like 'javax.validation.constraints.Size.message' but seems that, the message is translated using the system locale only and not that of the user that I can retrieve from HttpRequest. From what I have discovered the DefaultValidator use the MessageSource without specifing any locale. I think that can be useful to plug a specific one instead. Thanks.

@yawkat yawkat added the type: enhancement New feature or request label Aug 17, 2022
@francesco-monorchio
Copy link

There are news about this? Thanks

@FrogDevelopper
Copy link
Contributor

Hello
Indeed, that would be a nice feature

@graemerocher graemerocher added the info: good first issue Good for newcomers label Jun 18, 2024
@graemerocher
Copy link
Contributor

not yet

@sdelamo sdelamo transferred this issue from micronaut-projects/micronaut-core Jan 31, 2025
sdelamo added a commit that referenced this issue Jan 31, 2025
sdelamo added a commit that referenced this issue Jan 31, 2025
* fix: resolve locale in message interpolator

Close: #485

* add @Inject
@FrogDevelopper
Copy link
Contributor

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info: good first issue Good for newcomers type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants