开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜