Tuesday, April 8, 2014

com.google.gwt.i18n.client.LocalizableResource.Generate.fileName() ?

Hi there,

I have created an incremental GWT generator that is creating an interface derived from com.google.gwt.i18n.client.Constants.
The problem is that the source of the generation is some class that is a representative for a resource bundle and I can not generate the Constants interface with the same name but want it to honor the localized properties with that base name. To make it clear, I have something like:

some/package/MyBundle.java
some/package/MyBundle_de.properties

From MyBundle.java my generator creates
some/package/MyBundleGwtINls.java

like this:

@Generate(format = "com.google.gwt.i18n.rebind.format.PropertiesFormat", fileName = "MyBundle")
public interface MyBundleGwtNls extends Constants {
  @DefaultStringValue("Reflective access for \"{accessible}\" failed!")
  String errorAccessFailed();
}

Now due to fileName property of @Generate I would expect GWT to honor MyBundle_de.properties located in the same package if it contains a property errorAccessFailed with a German translation.

Is my understanding of the JavaDoc of fileName() wrong? Is there any way to archive my goal with GWT I18N? Any other ideas?

BTW: I used to annotate my source of generation with a relocated bundle name and used that for the localized properties and the generated Constant interface what used to work. However, then I failed to properly implement support for non GWT environments (my java.util.ResourceBundle.Control implementation then is in trouble).

Thanks
  Jörg

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment