2013-08-20 37 views
0

我基本上有以下配置。 我app.gwt.xml包含如下模块和设置GWT本地化生成消息

<inherits name="com.google.gwt.i18n.I18N"/> 
<extend-property name="locale" values="en_US, de_DE, default"/> 
<set-property name="locale" value="default"/> 
<set-property-fallback name="locale" value="en_US"/> 

<!-- Localization --> 

<generate-with class="app.com.gen.MyGenerator"> 
    <when-type-assignable class="app.com.msg.IMessages" /> 
</generate-with> 

我的发生器产生每取决于可用的locale的一个HashMap中。 我正在使用GWT.create(MyMessages.class)。 MyMessages实现接口app.com.msg.IMessages

所以现在在编译时我有3个排列,什么是好的。 当我运行我的示例时,我只能看到具有默认语言环境的页面,如果我将URL参数更改为& locale = de_DE或其他任何内容, 无关紧要。

我也开始加入参数

<head> 
<meta name="gwt:property" content="locale=en_US"> 
</head> 

到我的HTML文件。

在DevMode中起作用,因为生成的MyMessages类是即时编译的,但不是当我运行编译版本时。 有何建议?由于

回答

1

尝试使用此配置:

<extend-property name="locale" values="en_US, de_DE"/> 
<set-property-fallback name="locale" value="en_US"/> 
<set-property name="locale" value="en_US, de_DE"/> 
+0

对不起,我迟到评论,我想我只是有一些问题需要初始化在登录时的URL语言环境参数。映射工作正常。 –