1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    63
    Vote Rating
    0
    jorgeluislay is an unknown quantity at this point

      0  

    Default Languages, having problems.

    Languages, having problems.


    Hello there!

    I am having some issues with the setting of more languages. How can i do this ?

    (Not asking for syntax, more asking for architektur)


    1) index.html
    combobox whit three languages:
    var language= "en"; //i choose english


    2) ApplicationLanguages.js

    Ext.ns("ApplicationLanguages.lang");
    myApp.lang.en{
    title01: "Hello there",
    key02: "value02"
    };

    myApp.lang.de{
    title01: "Hallo wie gehts",
    key02: value02
    };

    myApp.lang.es{
    title01: "Como estas ?",
    key02: value02
    };


    So this, works fine:

    MyGrid = Grid {(
    title: myApp.lang.en.title01,
    ...
    )};



    When i change this to spanish or german, it remains english so i changed it to this:

    MyGrid = Grid {(
    title: myApp.lang. + language + .title01,
    ...
    )};

    syntax error. so next change without dots and:

    var language = ".en."

    MyGrid = Grid {(
    title: myApp.lang + language + title01,
    ...
    )};

    So here i dont get any syntax errors but it doesnt get dynamically what i want it to do. Of course is language a String and does not work getting the json class what i need. but i dont know how to do it.

    Any help please ?

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    63
    Vote Rating
    0
    jorgeluislay is an unknown quantity at this point

      0  

    Default


    any help on this ?

    i think it is ok to know about some search words, that i can be looking in google!

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    546
    Vote Rating
    52
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    I wouldn't include all language strings in one file - since this means the user is downloading and populating numerous variables which will never be used (i.e. If English is selected, the German, Spanish, French, etc variables are never needed).

    Instead, I would have a separate language string file for each language, which all contain the exact same variables - then simply load the correct version of this file depending on which language they have selected?

    An example:
    http://dev.sencha.com/deploy/ext-3.4...ulti-lang.html

  4. #4

Thread Participants: 2