如何检测浏览器的语言并根据该值自动显示grails网站的正确本地化版本。
最佳答案
By default the user locale is detected from the incoming Accept-Language header. However, you can provide users the capability to switch locales by simply passing a parameter called lang to Grails as a request parameter:
/book/list?lang=es
Grails will automatically switch the user locale and store it in a cookie so subsequent requests will have the new header.
关于grails - 检测浏览器语言以进行自动本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8223895/