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

      0  

    Default Localization: Efficient way to use Spring MVC localization and Ext-JS

    Localization: Efficient way to use Spring MVC localization and Ext-JS


    Hi

    I am using Spring MVC - ResourceBundleMessageSource/SessionLocaleResolver
    for localization with the locale message stored in a properties file on the server.
    I then have placed the Ext-JS code in a JSP file and I access the locale messages as follows:

    <spring:message code="panel1.applyMessage"/>


    This all works perfectly.

    However, from an efficiency point of view, should the Ext-JS code be in JS files instead ?
    If so then I wont be able to use the Spring messages. What is the best way to fetch the messages ?
    Anyone have any pointers as to correct way to do this ?

    Cheers Dave

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Not having used this before, are you able to get all locale upfront?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    7
    Vote Rating
    0
    pleuraxeraphim is on a distinguished road

      0  

    Default


    Yeah I can get all locale messages to the client. However I don't think that this would be the most efficient way of doing this as it might slow the client. Should I be using ajax calls to get locale messages ?

    Ideally all my Ext-Js should be in JS files and I shoul;d then use Ajax or something to fetch the locale messages instead of using Spring Messages ? Would that be correct ?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ajax is async so if you want to wait for the ajax to return to create your component that is fine.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    aday.guerra is on a distinguished road

      0  

    Default


    Quote Originally Posted by pleuraxeraphim View Post
    Hi

    I am using Spring MVC - ResourceBundleMessageSource/SessionLocaleResolver
    for localization with the locale message stored in a properties file on the server.
    I then have placed the Ext-JS code in a JSP file and I access the locale messages as follows:

    <spring:message code="panel1.applyMessage"/>


    This all works perfectly.

    However, from an efficiency point of view, should the Ext-JS code be in JS files instead ?
    If so then I wont be able to use the Spring messages. What is the best way to fetch the messages ?
    Anyone have any pointers as to correct way to do this ?

    Cheers Dave
    Hi Dave,

    Did you make this work in the original way you were trying? I mean, did you get Spring messages (tags) be resolve inside of a external Js file?

    Thanks

  6. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    2
    Vote Rating
    0
    jiffyjub is on a distinguished road

      0  

    Default anyone

    anyone


    Anyone has ideas on how to get the localization without the spring message tag ?