2012-10-17 45 views
0

我试图设置资源属性文件来本地化我的应用程序。gwt i18n LocalizableResource文件路径

public static interface MenuConstants extends Constants { 

    String categoryCells(); 

} 

,我有相应的LocalizableResource_en.properties

categoryCells = Cell Widgets 

但它在这一行失败:

MenuConstants constants = GWT.create(MenuConstants.class); 

随着消息:

[TRACE] [XX] - Generating method body for categoryCells() 
    [ERROR] [XX] - No resource found for key 'categoryCells ' 
    [WARN] [XX] - Searched the following resources: 

我想知道我在哪里ld把*.properties文件得到GWT来找到资源?

gwt.xml文件:

<inherits name="com.google.gwt.i18n.I18N"/> 
<inherits name="com.google.gwt.i18n.CldrLocales"/> 

<extend-property name="locale" values="en"/> 
<extend-property name="locale" values="fr"/> 
<set-property-fallback name="locale" value="en"/> 

回答

2

According to the Dev Guide,如果你希望你的常量是在UiBinder的模板访问,以及在你命名文件LocalizableResource_<locale>.properties,并把它们放在包com.google.gwt.i18n.client Java代码。适用于我。