title: How to implement i18n in GWT application?
body: <p>I have a problem with internationalization. I'm trying to implement support two languages ​​in my GWT application. Unfortunately I never found a complete example how to do it with the help of UiBinder. That is what I did:</p>
  
  <p>My module <strong>I18nexample.gwt.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module rename-to='i18nexample'&gt;
  &lt;inherits name="com.google.gwt.user.User" /&gt;
  &lt;inherits name='com.google.gwt.user.theme.clean.Clean' /&gt;
  &lt;inherits name="com.google.gwt.i18n.I18N" /&gt;
  &lt;inherits name="com.google.gwt.i18n.CldrLocales" /&gt;
  &lt;entry-point class='com.myexample.i18nexample.client.ExampleI18N' /&gt;
  &lt;servlet path="/start" class="com.myexample.i18nexample.server.StartServiceImpl" /&gt;
      &lt;extend-property name="locale" values="en, fr" /&gt;
      &lt;set-property-fallback name="locale" value="en" /&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>My interface <strong>Message.java</strong>:</p>
  
  <pre><code>package com.myexample.i18nexample.client;
  
  import com.google.gwt.i18n.client.Constants;
  
  public interface Message extends Constants {
  
      String greeting();
  }
  </code></pre>
  
  <p>The same package <code>com.myexample.i18nexample.client</code> has three properties file:</p>
  
  <p><strong>Message.properties</strong>:</p>
  
  <pre><code>greeting = hello
  </code></pre>
  
  <p><strong>Message_en.properties</strong>:</p>
  
  <pre><code>greeting = hello
  </code></pre>
  
  <p><strong>Message_fr.properties</strong>:</p>
  
  <pre><code>greeting = bonjour
  </code></pre>
  
  <p>My UiBinder file <strong>Greeting.ui.xml</strong>:</p>
  
  <pre><code>&lt;!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"&gt;
  &lt;ui:UiBinder 
      xmlns:ui="urn:ui:com.google.gwt.uibinder"
      xmlns:g="urn:import:com.google.gwt.user.client.ui"
      ui:generateFormat="com.google.gwt.i18n.rebind.format.PropertiesFormat"
      ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
      ui:generateLocales="default" &gt;
      &lt;ui:with type="com.myexample.i18nexample.client.Message" field="string" /&gt;
      &lt;g:HTMLPanel&gt;   
          &lt;ui:msg key="greeting" description="greeting"&gt;Default greeting&lt;/ui:msg&gt;     
      &lt;/g:HTMLPanel&gt;
  &lt;/ui:UiBinder&gt; 
  </code></pre>
  
  <p>When the application starts, I always get the output in the browser:</p>
  
  <pre><code>Default greeting
  </code></pre>
  
  <p>Why? What am I doing wrong? </p>
  
  <p>I tried to run the application from different URL:</p>
  
  <pre><code>http://127.0.0.1:8888/i18nexample.html?gwt.codesvr=127.0.0.1:9997
  
  http://127.0.0.1:8888/i18nexample.html?locale=en&amp;gwt.codesvr=127.0.0.1:9997
  
  http://127.0.0.1:8888/i18nexample.html?locale=fr&amp;gwt.codesvr=127.0.0.1:9997
  </code></pre>
  
  <p>The result does not change. Although I expected in last case a message <code>bonjour</code>.</p>
  
  <p>If for example I use a <code>g:Buttton</code> instead of the message <code>ui:msg</code>:</p>
  
  <pre><code>&lt;g:HTMLPanel&gt;   
       &lt;g:Button text="{string.greeting}" /&gt;      
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>Then I get as a result of the button with text <code>"hello"</code></p>
  
  <p>And if I enter the URL:</p>
  
  <pre><code>http://127.0.0.1:8888/i18nexample.html?locale=fr&amp;gwt.codesvr=127.0.0.1:9997
  </code></pre>
  
  <p>The text on the button changes to <code>"bonjour"</code>. Here everything works as expected. But why internationalization is not working in my first case? </p>
  
  <p>And whether there is a difference between the following:</p>
  
  <pre><code>&lt;ui:msg description="greeting"&gt;Default greeting&lt;/ui:msg&gt;
  
  &lt;ui:msg description="greeting"&gt;hello&lt;/ui:msg&gt;
  
  &lt;ui:msg description="greeting"&gt;&lt;/ui:msg&gt;
  </code></pre>
  
  <p>Should there be different results in these cases? How to write properly?</p>
  
  <p>Please explain to me the principles of internationalization in GWT and why my example does not work.
  Any suggestions would be greatly appreciated.</p>