Skip to content

Instantly share code, notes, and snippets.

@KacT9H
Created January 16, 2017 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KacT9H/236e684459c698a38533c046b45c5d56 to your computer and use it in GitHub Desktop.
Save KacT9H/236e684459c698a38533c046b45c5d56 to your computer and use it in GitHub Desktop.
class HomeController {
def springSecurityService
//...
def changeLocale(String locale) {
def user = springSecurityService.currentUser as User
user.locale = new Locale(locale)
user.save()
//put locale to lang param
redirect action: 'index', params: [lang: locale]
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment