本文介绍了如何获取GWT应用程序的语言环境信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在GWT中,我必须指定我的应用程序支持哪些语言环境。代码被编译成各种文件,每个语言环境一个(除了其他版本),但我必须给我的客户一个唯一的URL。这个URL应该是一个应该根据浏览器首选的区域显示的页面。
我不想为语言环境提供HTTP参数,因为我想修改浏览器首选的语言环境。
如何在GWT中进行编码?

In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser.I dont't want to have an HTTP parameter for the locale since I want to forse the locale preferred by the browser.How can this be coded in GWT?

我应该尝试使用apache重写规则吗?我认为,但我认为我无法在重写规则中轻松地访问这些参数。

Should I try to to this using apache rewrite rules? I thied it, but I think I cannot access such parameter easely in a rewrite rule.

非常感谢,
Giuseppe

Thanks a lot,Giuseppe

推荐答案

我和你有同样的问题,但因为我真的需要知道当前的语言环境(我正在请​​求第二台服务器来处理我想要的数据本地化)我发现这个类:
com.google.gwt.i18n.client.LocaleInfo#getCurrentLocale()。这应该会给你目前使用的GWT。

I had the same problem as you, but as I really need to know the current locale (I'm requesting a second server for data that I want to be localizable) I found this class:com.google.gwt.i18n.client.LocaleInfo#getCurrentLocale(). That should give you what GWT uses currently.

这篇关于如何获取GWT应用程序的语言环境信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 06:23
查看更多