Results 1 to 5 of 5

Thread: extjs localization in multiple languages

  1. #1

    Red face extjs localization in multiple languages

    I want my application in multiple languages, so how it is possible in extjs to do localization in multiple languages

    please provide some working code for refrence if possible.

  2. #2

    Default

    There's two options: 1) Store the localized text in a database and cache/retrieve it as necessary using inlined method calls.
    2) Store the localized text in some code files and call methods to retrieve it as necessary (again, using inlined method calls)

    Those above two will be the easiest/fastest to implement, I think. I use #1 in our app here because of a pre-existing component for modifying/storing/loading such info -- but if I wanted to support multiple languages in the speediest (execution-time wise) manner I would probably use #2.

    For instance, in PHP, retrieve a country code via a query parameter when the page is loaded, and then in your code:
    <?php
    require ( "localized_text_" . $country_code . ".php");
    ?>

    Now, assuming every localized text code file has the same set of methods, you should be able to just call them as necessary to get the strings you want. The disadvantages of approach #2 are that while it is potentially faster performance-wise, it MAY be more difficult/insecure to build a GUI interface for managing the localization strings. You'd probably want a development version of the app exposed if only private, approved users will be updating the localization strings -- because the file permissions (in the instance of Unix) would potentially need to be 777 - world-writable - so that your GUI data management script could overwrite it....
    [unless your webserver is running as the same user as the owner of your files]

    Anyway, as you can see -- there are tradeoffs. The database+caching approach may be better for large applications, the code files approach may be more suitable for smaller applications. Also, none of this really has anything to do with ExtJS -- it's more dependent on the server-side programming language you're using.

    -Ryan

  3. #3
    Touch Premium Member msinn's Avatar
    Join Date
    Jul 2009
    Location
    in front of my pc
    Posts
    280

    Default

    Quote Originally Posted by vijaypatil12 View Post
    I want my application in multiple languages, so how it is possible in extjs to do localization in multiple languages

    please provide some working code for refrence if possible.

    http://www.sencha.com/learn/Tutorial:Localizing_Ext
    http://www.sencha.com/forum/showthre...4-Localization
    http://dev.sencha.com/deploy/dev/exa...utch-form.html
    http://dev.sencha.com/deploy/dev/exa...&charset=utf-8
    http://www.sencha.com/forum/showthre...t-Translations
    First I would like to thank you for your time and knowledge

    Win 7 Ext JS 4.1.3 IE(6-9), FF17

  4. #4

    Default

    Oh, right. I totally forgot about those links We have a pretty specialized app here so I guess I spaced on 'the ExtJS way'.

  5. #5
    Sencha User
    Join Date
    Aug 2008
    Posts
    28

    Default

    PS,

    I have one form with few text fields and combos, text field in english version accepts only alphanumeric values [A-Za-z]; how to deal with this with different language like Spanish.

    Thanks
    SB

Similar Threads

  1. Multiple Languages
    By Angilo in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 Sep 2010, 7:40 AM
  2. use regional languages in extjs
    By pailyanish in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 10 Jun 2009, 5:49 AM
  3. using multiple languages in fieldLabels
    By rommirommi in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 2 Jun 2009, 5:23 AM
  4. Localization with Extjs!
    By Arpita2u.k in forum Ext 1.x: Help & Discussion
    Replies: 16
    Last Post: 2 Apr 2009, 4:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •