Grail sets the language (internationalization) via URL mappin

I am interested in supporting English and French in my Grails app with a convenient URL.

format: / appname / language / controller / action

example: / store / ru / product / list

What is the best way without passing as a parameter (? Lang = fr) and then rewriting the url.

thanks

+4
source share
1 answer

Adding the following mapping to your application name \ grails-app \ conf \ UrlMappings.groovy should do this.

"/$lang/$controller/$action?/$id?"{ } 

See URL mapping on grails website for more details.

+2
source

Source: https://habr.com/ru/post/1299089/


All Articles