• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to support multiple languages on UI

 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Can any of u reply with few lines of code reg how to display text on UI based on user selected language. I want to diplay it on UI using JSPs. One guy sugested to put all the language names and corresponding language converted texts in XML file and whenever request comes, select the language and its assigned text from XML(according to user selected language).

Other friend suggested to use ResourceBundle class.

Can u pls tell me the perfect solution with few lines of sample code....
I will be thankful to u folks. Pls reply ASAP, its urgent.

Mail me: javardhan@gmail.com
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be urgent for you. But sorry no sample codes with me.

You need to see i18n Implementation Technique. Here is a free ebook.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make different properties files for each language & locale combination (which you need) and then use ResourceBundle to access the property. Remaining work ResourceBundle will do automatically.

One more thing, pass the locale and language of client browser (get from the request) in the constructor of ResourceBundle, at the time of creating ResourceBundle object.

Hope it will help.
[ May 11, 2005: Message edited by: rathi ji ]
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frends,

Thnx for ur reply n Sorry for my late reply (i was on leave).

I used that Locale n ResouceBundle classes, now am ablw to display single byte character langs like French and Italian but not able to display double byte langs like Japanese and Chinese.

I am able to type those Japanese n Chinese like langs from keyboard in to a text field on UI and am just trying to display on other page, but they r getting displayed llike ???d2???a.
Whats the solution for this??

Thnx once again for ur nice replies ...
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Dear Frends..

Pls. reply to the above question. I am trying n trying but not able to solve. Can any of u guyz pls tell me the solution.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ja vardahn,

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

thanks,
bear
Forum Bartender
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you get the solution for this???


(It should be related to encoding...)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!