How to add a new locale to GXT XMessages?
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.
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.
Tags for this Thread