Grails set language (internationalization) via URL mappin
I'm interested in supporting English and French in my Grails app with user-friendly URL.
format: /appname/language/controller/action
example: /store/en/product/list
What开发者_Python百科 is the best way without passing as a parameter (?lang=fr) then rewriting the URL.
Thanks
Adding the following mapping in your appname\grails-app\conf\UrlMappings.groovy should do it.
"/$lang/$controller/$action?/$id?"{
}
See the URL mapping article on the grails website for details.
精彩评论