Best way to implement multiple/editable languages in a web-app?

Discussion in 'Java' started by Dag Sunde, Dec 16, 2006.

  1. Dag Sunde

    Dag Sunde Guest

    I'm in the design-phase of developing a "Web-App" with TomCat
    on the serverside, and Firefox in kiosk-mode and a touch screen
    on the client.

    The complete app is going to be max 10-12 jsp-pages, where the
    text-content is reasonably stable.

    One of the requirements is that the language on the pages have
    to be easy for the customer to extend to new languages. (The
    user is presented with a choice between the available languages
    in the first page).

    What my customer want is to be able to add a new language file
    in ie. "Klingon" in 6 months time, update the config file on the
    server, and the next user that use the app, will now have Klingon
    to select from too...

    My idea is to give every element on every page a unique id. Then
    create an xml or property file for each language. Then create a
    getText(id) method somewhere that i use in each .JPS page on every
    element.

    Does anyone have some thougts on how to implement this in a clean
    and extensible way?

    Ideas? pointers? patterns?

    TIA...

    --
    Dag.
     
    Dag Sunde, Dec 16, 2006
    #1
    1. Advertising

  2. Dag Sunde

    Lew Guest

    Dag Sunde wrote:
    > One of the requirements is that the language on the pages have
    > to be easy for the customer to extend to new languages. (The
    > user is presented with a choice between the available languages
    > in the first page).


    http://java.sun.com/j2se/1.5.0/docs/api/java/util/ResourceBundle.html

    > What my customer want is to be able to add a new language file
    > in ie. "Klingon" in 6 months time, update the config file on the
    > server, and the next user that use the app, will now have Klingon
    > to select from too...


    You would create a resource bundle for locale "tlh"
    (<http://www.loc.gov/standards/iso639-2/php/English_list.php>).

    - Lew
     
    Lew, Dec 16, 2006
    #2
    1. Advertising

  3. Dag Sunde

    Dag Sunde Guest

    Lew wrote:
    > Dag Sunde wrote:
    >> One of the requirements is that the language on the pages have
    >> to be easy for the customer to extend to new languages. (The
    >> user is presented with a choice between the available languages
    >> in the first page).

    >
    > http://java.sun.com/j2se/1.5.0/docs/api/java/util/ResourceBundle.html
    >


    Thanks... Looks like a solution!

    >> What my customer want is to be able to add a new language file
    >> in ie. "Klingon" in 6 months time, update the config file on the
    >> server, and the next user that use the app, will now have Klingon
    >> to select from too...

    >
    > You would create a resource bundle for locale "tlh"
    > (<http://www.loc.gov/standards/iso639-2/php/English_list.php>).
    >


    LOL!
    There actually *is* an ISO code for Klingon?

    --
    Dag.
     
    Dag Sunde, Dec 16, 2006
    #3
  4. Dag Sunde

    Daniel Pitts Guest

    Dag Sunde wrote:
    > Lew wrote:
    > > Dag Sunde wrote:
    > >> One of the requirements is that the language on the pages have
    > >> to be easy for the customer to extend to new languages. (The
    > >> user is presented with a choice between the available languages
    > >> in the first page).

    > >
    > > http://java.sun.com/j2se/1.5.0/docs/api/java/util/ResourceBundle.html
    > >

    >
    > Thanks... Looks like a solution!
    >
    > >> What my customer want is to be able to add a new language file
    > >> in ie. "Klingon" in 6 months time, update the config file on the
    > >> server, and the next user that use the app, will now have Klingon
    > >> to select from too...

    > >
    > > You would create a resource bundle for locale "tlh"
    > > (<http://www.loc.gov/standards/iso639-2/php/English_list.php>).
    > >

    >
    > LOL!
    > There actually *is* an ISO code for Klingon?
    >
    > --
    > Dag.


    Ofcourse! I think Google even has a Klingon locale version.
     
    Daniel Pitts, Dec 16, 2006
    #4
  5. Dag Sunde wrote:
    > LOL!
    > There actually *is* an ISO code for Klingon?


    Only in the expanded 3-character system.

    There are also codes for Esperanto, Volap√ľk, Ido, Interlingua, and
    Lojban, and there are dozens of natural languages listed that I never
    heard of. (Though there is at least one natural language that I know of,
    Tulu, that they don't list.)

    --
    John W. Kennedy
    "The blind rulers of Logres
    Nourished the land on a fallacy of rational virtue."
    -- Charles Williams. "Taliessin through Logres: Prelude"
     
    John W. Kennedy, Dec 16, 2006
    #5
  6. Dag Sunde

    Lew Guest

    > Dag Sunde wrote:
    >> LOL!
    >> There actually *is* an ISO code for Klingon?


    John W. Kennedy wrote:
    > Only in the expanded 3-character system.


    Which apparently is supported in the Java locale mechanism. I have not tried
    it myself, but the Sun Javadocs link right into ISO-639-2 documentation.

    - Lew
     
    Lew, Dec 17, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josh K.
    Replies:
    0
    Views:
    316
    Josh K.
    Aug 25, 2003
  2. Alan Silver
    Replies:
    2
    Views:
    458
    Alan Silver
    Jul 4, 2005
  3. Mohammad
    Replies:
    1
    Views:
    408
  4. John Davis
    Replies:
    0
    Views:
    167
    John Davis
    Aug 22, 2003
  5. modi

    best way implement web service with authentication.

    modi, Jan 24, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    125
    WishMaster
    Jan 31, 2007
Loading...

Share This Page