Struts / 国际化 (I18N)
我正在开发一个网络应用程序,并且我将每种语言分解为 *_lang.properties。如果我更改浏览器语言,UI 中会出现相应的语言,这很棒,但它需要重新启动我的浏览器(FF 和 IE)。其他网站只需刷新页面即可识别语言更改。
为了不强制浏览器重新启动,我是否缺少某些内容?
I've got a web app that I am working on, and I have each of my languages broken up into *_lang.properties. If I change the browser language, the appropriate language appears in the UI which is great, but it requires my browser (both FF and IE) to be restarted. Other websites recognize the language change with just a page refresh.
Is there something I am missing in order to not force a browser restart?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
语言设置很可能存储在服务器端的会话中。您应该能够更改负责加载资源包的代码部分,以始终检查请求标头以查看应加载哪个区域设置的资源包。
Most probably the language settings are stored in the session on the server side. You should be able to change that part of the code responsible for loading resource bundles to always check the request headers to see which locale's resource bundle should be loaded.