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

D

Dag Sunde

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...
 
L

Lew

Dag said:
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
 
D

Daniel Pitts

Dag said:
Thanks... Looks like a solution!


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

Ofcourse! I think Google even has a Klingon locale version.
 
J

John W. Kennedy

Dag said:
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.)
 
L

Lew

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top