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

Using different Messages for details based on locale #594

Open
cmdjulian opened this issue Feb 8, 2021 · 0 comments
Open

Using different Messages for details based on locale #594

cmdjulian opened this issue Feb 8, 2021 · 0 comments
Labels

Comments

@cmdjulian
Copy link

Hi,
In our project we are using Springs MessageSource Interface to retrieve a Message based on a key. The MessageSource class picks the corresponding message based on the key in the corresponding locale in the corresponding language. You can picture it like this:

@Autowired
private lateinit var messageSource: MessageSource

ErrorResponse(
    HttpStatus.BAD_REQUEST,
    messageSource.getMessage("spring.mismatched-input", locale),
    request.servletPath
)

Is there an easy way to integrate Springs Message Source into the problem framework without explicitly overriding each prepare method? I want to be able to provide "details" in the corresponding requester locale.
Thanks for your help in advance.

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