1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    hjbolide is on a distinguished road

      0  

    Question How to add a new locale to GXT XMessages?

    How to add a new locale to GXT XMessages?


    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.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    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.

Thread Participants: 1

Tags for this Thread