Change i18n locale from a controller before calling the view
Hello everyone,
I have a simple problem I don't know how to resolve.
I get the params.lang = 'en' from the user, but within the controller we detect where the IP comes from and depending on that, we want to change the locale from 'en' to whatever the language corresponds to the geographic location of the user.
For instance, if we want the view to be rendered in Spanish, just by simply setting lang = 'es' in the controller code does not do anything. The view is still being rendered in English 'en'.
Anyone knows how to use the u18n support in Grails to change a locale within a controller before the view is called?
Thanks a million!