PDA

View Full Version : How to add a new locale to GXT XMessages?



hjbolide
13 Feb 2012, 7:52 PM
Hi All,

I'm currently using GXT and want to add another language set to it, I searched in the forum and all the things mentioned were about modifying gxt.jar, that's not very elegant though. Because I wrote an script to pull gxt.jar from Sencha once my app comes to a new environment. Modifying gxt.jar seems not a good way to go in my context.

So is there any possibility that we can add another .properties file outside the gxt.jar? any changes should be made in the code?

Thanks a lot for everyone who reads it.

Colin Alworth
14 Feb 2012, 9:07 AM
It should be possible to create a new properties file and put it in your project in the package where the other xmessages properties exist. As long as it is on the classpath at compile time (and your new locale is mentioned in your module) it should be able to read in that file.

If that doesn't work, you could subinterface XMessages, and assign your instance instead of the GXT provided instance when your app starts up. In your onModuleLoad, call

GXT.MESSAGES = GWT.create(MyXMessages.class);

Make sure to copy over any existing properties files for locales that you want to continue to use.