【问题标题】:Error In Internationalize a GWT UIBinder page with Messages使用消息国际化 GWT UIBinder 页面时出错
【发布时间】:2023-06-14 21:29:01
【问题描述】:

我们将 GWT 和 GWTP 与 UiBinder 一起使用,我想将属性文件用于消息。 我也见过GWT app with UiBinderThis one

1) gwt.xml 文件中的条目

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

 2) 在 LoginView.ui.xml 中

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:fmt="ui:with:com.nextenders.client.properties.NTCommonPropeties"
ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys='com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator'
ui:generateLocales="en">

我已经创建了一个文件和接口,并在 Xml 中添加。

<ui:with field='fmt' type='com.nextenders.client.properties.LocalizableResource'/>

现在我正在尝试使用

现在我正在尝试使用“-extra”选项进行编译。 但我收到“No resource found for key”错误。

按顺序需要经过here.描述的所有步骤 我的意思是我应该在编译后设置消息吗?

更新:我已删除 &lt;g:Label text="{fmt.loginBoxTitle}" styleName= "login_label" /&gt;。但是编译的时候还是报同样的错误。

【问题讨论】:

    标签: gwt uibinder


    【解决方案1】:

    我找到了解决方案。错误 "No resource found for key 表示 GWT 编译器无法找到您指定的键的映射。例如。 loginBoxTitle 在我的{fmt.loginBoxTitle}

    我已经重新检查了文件的映射。它奏效了。

    【讨论】: