title: GWT ImageResource with locale specific url
body: <p>Is it possible to have GWT <strong>ImageResource</strong> with <em>locale specific</em> url, without having to replicate the underlying images?</p>
  
  <p>I read the url of an image influences SEO, one ought to pick good meaningful key words for improved ranking.  So I would ideally like to have the locale specific keywords in the image url, that is the image name coming from a i18n Constants class.</p>
  
  <p>Could it be as simple as calling myImageResource.setUrl?  If so, does it matter when to call it?</p>
  
  <p>Or is there an annotation to set the url?</p>
  
  <p>Below is some code context.</p>
  
  <pre><code>public interface MyImageBundle extends ClientBundle
  {
    public static final MyImageBundle INSTANCE = GWT.create(MyImageBundle.class);
  
    public static final String IMAGE_PATH = "image/";
  
    @Source(IMAGE_PATH + "foo1.png")
    ImageResource foo1();
  
    @Source(IMAGE_PATH + "foo2.png")
    ImageResource foo2();
  }
  </code></pre>
  
  <p>In the browser, I would like the url's to look something like that:</p>
  
  <ul>
  <li>French:
  <ul>
  <li>foo1: mydomain.com/myFrenchPath/myFrenchKeywordFoo1.png</li>
  <li>foo2: mydomain.com/myFrenchPath/myFrenchKeywordFoo2.png</li>
  </ul></li>
  <li>English:
  <ul>
  <li>foo1: mydomain.com/myEnglishPath/myEnglishKeywordFoo1.png</li>
  <li>foo2: mydomain.com/myEnglishPath/myEnglishKeywordFoo2.png</li>
  </ul></li>
  <li>...</li>
  </ul>
  
  <p>Images foo1 &amp; foo2 are the same in all locales, I just want the url to be locale specific.</p>
  
  <p>I would ideally like the path and keywords forming the url to come from a Constants, something like:</p>
  
  <pre><code>public interface MyConstants extends com.google.gwt.i18n.client.Constants
  {
    String path();
    String keywordFoo1();
    String keywordFoo2();
  }
  MyConstants myConstant = (MyConstants) GWT.create(MyConstants.class);
  </code></pre>
  
  <p>Would the following work?  Would it be the right way to go about it?</p>
  
  <pre><code>Image foo1Image = new Image(MyImageBundle.INSTANCE.foo1());
  foo1Image.setUrl(myConstant.path() + "/" + myConstant.keywordFoo1() + ".png");
  </code></pre>
  
  <p>Or is there an annotation to set the url in MyImageBundle?</p>