【发布时间】:2012-06-14 05:33:39
【问题描述】:
我已经为 java、UI Binder 提供了 GWT 的 i18n 功能,并尝试为 i18n 提供纯的、非托管在 java HTML 文件中。
阅读“Declarative Layout with UiBinder”后,我实现了一些代码,但没有成功:
<html xmlns:ui="urn:ui:com.google.gwt.uibinder">
<ui:with field='i18n' type='//.exampleConstants'/>
<head>
<title>Title of none-hosted HTML file and i18n part: <ui:text from='{i18n.title}'/></title>
</head>
<body>
...
</body>
</html>
具有 id 的解决方案(在同一页面上描述:https://developers.google.com/web-toolkit/doc/latest/tutorial/i18n/)将由 RootPanel 提取,类似:
RootPanel.get("appTitle").add(new Label(constants.stockWatcher()));
也没有用,因为我的 HTML 文件没有与 Java 捆绑在一起。
如何在 HTML 文件中做 i18n?
【问题讨论】: