1. #51
    Sencha Premium Member The One's Avatar
    Join Date
    Dec 2012
    Location
    Chennai, India
    Posts
    4
    Vote Rating
    0
    The One is on a distinguished road

      0  

    Default

    Quote Originally Posted by Phil.Strong View Post
    Sencha Architect 2.2 (coming soon) will include a new feature called process config.

    This allows you to integrate ideas like Localizer much more easily. More details to come from the author of this feature.
    Wonderful. Worth the two year wait I guess. Can't wait to hear more.
    ✝♄ℯ ☮ηℯ

  2. #52
    Sencha User
    Join Date
    Dec 2012
    Location
    Spain
    Posts
    7
    Vote Rating
    0
    Zeigon is on a distinguished road

      0  

    Default

    In my opinion, using a localization system with the English (or any other language) translation as the key of the translations file is wrong. I'm all for string keys with generic names that make life easier and (among other things) don't bloat the files with unnecessary text . Like in Android and, as far as I know, unlike in iOS, which also uses translations as keys.

    Looking at the code of the Localizer class, the format of the locale files could be changed to something like <ComponentID>.<PropertyName>, i.e.:
    Code:
    //en.js
    {key: "buttonBrowse.text", value: "Browse..."},
    {key: "buttonBrowse.tooltip", value: "Browse for a file."},
    
    //es.js
    {key: "buttonBrowse.text", value: "Explorar..."},
    {key: "buttonBrowse.tooltip", value: "Elige un archivo."},
    So you could continue iterating through the localizable properties but instead of checking for the English string you would do it exactly for the element and property that you want. You could even implement a fallback method where in the case that you couldn't find a translation in a certain locale (replace==null) you could still use the English text as a last resort. This might require to load the English strings no matter what the current locale were or implement some kind of on-the-fly string loading, although I don't think this would be necessary.

  3. #53
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,407
    Vote Rating
    301
    ssamayoa is an unknown quantity at this point

      0  

    Default

    Quote Originally Posted by Zeigon View Post
    In my opinion, using a localization system with the English (or any other language) translation as the key of the translations file is wrong.
    Could be but Localizer is, as I said, for all those exiting applications which must be translate without too much coding or for those generated with *CURRENT* version of Architect.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  4. #54
    Sencha User
    Join Date
    Dec 2012
    Location
    Spain
    Posts
    7
    Vote Rating
    0
    Zeigon is on a distinguished road

      0  

    Default

    Well, I was just saying because now that someone took the time to create this class, github project, etc. to share the Localizer with everyone, maybe we could all contribute with some ideas that might improve it. Besides, now that the big effort is already made I don't think it'd require too much extra coding.

  5. #55
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,407
    Vote Rating
    301
    ssamayoa is an unknown quantity at this point

      0  

    Default FWIW I will start to use Localizer

    FWIW, after almost a year I wrote the original code, I will start to use Localizer.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  6. #56
    Sencha User
    Join Date
    Mar 2007
    Posts
    786
    Vote Rating
    8
    franklt69 is on a distinguished road

      0  

    Default

    Hi I was playing with this component https://github.com/devotis/Ext.ux.Localizer and work ok, but I added a container, in the html properties set "hello"

    en.js
    {key: "hello", value: "hello container"}

    es.js

    {key: "hello", value: "hola contenedor"}

    and in Ex.ux.Localizer.js I added


    Code:
     localizableProps : {
          ....
            image: ["src"],
            container: ["html"]
        },
    but not work, am I missing something to added a new xtype to localizable list?

    regards
    Frank

  7. #57
    Sencha Premium Member jasonsti's Avatar
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    2
    jasonsti is on a distinguished road

      0  

    Default

    i know this like a real old post, question does this work with sencha touch?

  8. #58
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    604
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default

    Quote Originally Posted by jasonsti View Post
    i know this like a real old post, question does this work with sencha touch?
    If what works?

  9. #59
    Sencha Premium Member jasonsti's Avatar
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    2
    jasonsti is on a distinguished road

      0  

    Default

    i have tryed it on architect 3 but an error came up

    TypeError: undefined is not a constructor (evaluating 'new Ext.util.HashMap()')

    not sure what i did wrong here,



    cheers

    Jason

  10. #60
    Sencha Premium Member jasonsti's Avatar
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    2
    jasonsti is on a distinguished road

      0  

    Default

    Quote Originally Posted by hotdp View Post
    If what works?
    the locale plugin