【发布时间】:2013-10-17 23:01:37
【问题描述】:
我正在使用 vaadin 框架,在我的应用程序中我有:
@Override
public void onRequestStart(HttpServletRequest request,
HttpServletResponse response) {
currentIP = request.getRemoteAddr();
setLocale(request.getLocale());
handle.set(this);
this.request = request;
this.response = response;
}
然而,request.getLocale() 返回en_US,这是我的操作系统语言环境。但是,在用于切换语言环境的 Firefox 插件中 (https://addons.mozilla.org/cs/firefox/addon/quick-locale-switcher/?src=userprofile),我将其设置为 cs_CZ,但是 getLocale() 仍将返回 en_US。
【问题讨论】:
-
您可以发布您从浏览器发送的
Accept-Language标头吗?我认为 Quick Locale Switcher 只会更改 Firefox UI,而不是 HTTP 标头。 -
en-us,ja;q=0.7,en;q=0.3。嗯,我认为插件改变了那件事,因为我想测试不同的语言环境来支持我的翻译...... -
尝试首选项->内容->语言。
标签: java firefox tomcat7 vaadin browser-addons