Commit e6996ff17b1f7848efac151d99cf80af061cad07

Internationalize the UI strings.

	* pom.xml: gwt-maven-plugin: Add the i18n goal and specify a
	<i18nConstantsBundle>, removing the unused <i18nMessagesBundle>.
	* src/main/resources/org/glom/web/client/Messages.properties: Remove this
	because it is unused. Messages are apparently strings that can have
	parameters, but we do not need that yet, so Contants will be enough for now.
	* src/main/java/org/glom/web/OnlineGlom.gwt.xml: Add extend-property lines
	to say that we support the en and de locales.
	* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants.properties:
	The original English strings.
	* src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_de.properties:
	Some German translations of the English strings.
	The i18n goal then uses the .properties file to generate an
	OnlineGlomConstants.java file in target/ and somehow GWT.create() magically
	returns an implementation that returns the translated strings.
	The documentation suggests putting these in src/java/*/client/, but it seems
	best to put it in src/resources/*/client/.
	* src/main/java/org/glom/web/client/ui/TableSelectionViewImpl.java:
	Instantiate OnlineGlomConstants via GWT.create() and use it to get the strings
	instead of hard-coding them.
	Note that we cannot import OnlineGlomConstants because it does not exist yet,
	but that does not seem to stop the build, though it confuses Eclipse.

	You can see the translated string by adding ?locale=de to the URL, like so:
	http://127.0.0.1:8888/OnlineGlom.html?gwt.codesvr=127.0.0.1:9997?locale=de#list:document=film_manager
ChangeLog
(29 / 0)
  
12012-01-26 Murray Cumming <murrayc@murrayc.com>
2
3 Internationalize the UI strings.
4
5 * pom.xml: gwt-maven-plugin: Add the i18n goal and specify a
6 <i18nConstantsBundle>, removing the unused <i18nMessagesBundle>.
7 * src/main/resources/org/glom/web/client/Messages.properties: Remove this
8 because it is unused. Messages are apparently strings that can have
9 parameters, but we do not need that yet, so Contants will be enough for now.
10 * src/main/java/org/glom/web/OnlineGlom.gwt.xml: Add extend-property lines
11 to say that we support the en and de locales.
12 * src/main/resources/org/glom/web/client/ui/OnlineGlomConstants.properties:
13 The original English strings.
14 * src/main/resources/org/glom/web/client/ui/OnlineGlomConstants_de.properties:
15 Some German translations of the English strings.
16 The i18n goal then uses the .properties file to generate an
17 OnlineGlomConstants.java file in target/ and somehow GWT.create() magically
18 returns an implementation that returns the translated strings.
19 The documentation suggests putting these in src/java/*/client/, but it seems
20 best to put it in src/resources/*/client/.
21 * src/main/java/org/glom/web/client/ui/TableSelectionViewImpl.java:
22 Instantiate OnlineGlomConstants via GWT.create() and use it to get the strings
23 instead of hard-coding them.
24 Note that we cannot import OnlineGlomConstants because it does not exist yet,
25 but that does not seem to stop the build, though it confuses Eclipse.
26
27 You can see the translated string by adding ?locale=de to the URL, like so:
28 http://127.0.0.1:8888/OnlineGlom.html?gwt.codesvr=127.0.0.1:9997?locale=de#list:document=film_manager
29
1302012-01-24 Murray Cumming <murrayc@murrayc.com>
231
332 Improve null/empty String checks.
pom.xml
(4 / 1)
  
138138 <executions>
139139 <execution>
140140 <goals>
141 <goal>i18n</goal>
141142 <goal>compile</goal>
142143 <goal>test</goal>
143144 </goals>
149149 <configuration>
150150 <runTarget>OnlineGlom.html</runTarget>
151151 <hostedWebapp>${webappDirectory}</hostedWebapp>
152 <i18nMessagesBundle>org.glom.web.client.Messages</i18nMessagesBundle>
152 <i18nConstantsBundles>
153 <i18nConstantsBundle>org.glom.web.client.ui.OnlineGlomConstants</i18nConstantsBundle>
154 </i18nConstantsBundles>
153155 </configuration>
154156 </plugin>
155157
  
2828
2929 <!-- Use the GWT internationalization framework -->
3030 <inherits name="com.google.gwt.i18n.I18N"/>
31 <extend-property name="locale" values="en"/>
32 <extend-property name="locale" values="de"/>
3133
3234</module>
  
2323
2424import org.glom.web.client.place.ListPlace;
2525
26import com.google.gwt.core.client.GWT;
2627import com.google.gwt.event.dom.client.ClickEvent;
2728import com.google.gwt.event.dom.client.ClickHandler;
2829import com.google.gwt.event.dom.client.HasChangeHandlers;
4141 */
4242public class TableSelectionViewImpl extends Composite implements TableSelectionView {
4343
44 // OnlineGlomConstants.java is generated in the target/ directory,
45 // from OnlineGlomConstants.properties
46 // by the gwt-maven-plugin's i18n (mvn:i18n) goal.
47 private OnlineGlomConstants constants = GWT.create(OnlineGlomConstants.class);
48
4449 Label documentTitleLabel = new Label();
4550 ListBox tablesChooser = new ListBox();
4651
47 Label searchLabel = new Label("Search");
52 Label searchLabel = new Label(constants.search());
4853 TextBox searchTextBox = new TextBox();
4954
5055 ListBox localesChooser = new ListBox();
5156
52 Anchor backLink = new Anchor("Back to List");
57 Anchor backLink = new Anchor(constants.backToList());
5358 private Presenter presenter;
5459 private HandlerRegistration backLinkHandlerReg;
5560
  
1# TODO: implement
2dropBoxLabel = Table Name
  
1#Human-visible strings to be translated in language specific versions of this property file
2search = Search
3backToList = Back to List
  
1search = Suche
2backToList = Back To List