Reputation: 3
I'm trying to change the default validation messages to other languages like French, Japanese or Chinese but there's only one default language(English) I can see in my project(I'm using Groovy/Grails Tool Suite 3.6.0).
The fastest way to solve this question is to overwrite the default validation messages file(messages.properties) with other one such as messages_ja.properties.
I'm just wondering if there is another "dynamic" way to achieve this
Thank you
Upvotes: 0
Views: 278
Reputation: 290
to change default langugage you can define something like this in your conf/spring/resources.groovy:
beans = {
localeResolver(SessionLocaleResolver) {
defaultLocale= Locale.JAPAN
Locale.setDefault (Locale.JAPAN)
}
}
Upvotes: 0
Reputation: 24776
If your application as a different default language from English then the best approach is:
This way English is still available for your application should you need to support it as well as your new default.
Upvotes: 2