Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use Internationalisation

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I am using .properties file for Rusian language support. However I am not able to pick up the values rwittnin Russian language in the .properties file. But when I use the unicode format , it works fine. Is there any way I can avoid use of this unicode format and use the key value pair in the same maner as that of english
Thanks in advance
Samir
 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please include code examples of what you tried but didn't work, and what you got to work. I've used properties files extensively, but am more of a code person than a language person
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chris for your instant reaply,
This is what the I want to achive
supppose my key value pair is
label.common.yes= yes
Now in order to disply this value in JSP , I am using the code
<bean:message key="label.common.yes" bundle="common" />
It works fine when the language is English
Now I want to print the value of the key "label.common.yes" in Rusian
But its not working fine ...but when I give the value of the key as uncode format say for eg.
label.common.yes=\u0414\u0430 and JSP code as
<bean:message key="label.common.yes" bundle="common" />
It works fine . But I dont want to stuck to this dirty unicode format.Is there any way I can use the key value pair same as that of the english language.I mean key and stright a way its value in Rusian
Any link, any help , any white paper for the same will be appriciated
Thanks and regards
Samir
 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have your locale default properties file defined in the struts-config.xml?

Quick example, not sure if this will help:

ApplicationResources.properties:
page.welcome=Welcome to my site!

ApplicationResources_it.properties: (Italian)
page.welcome=I dont speak italian, but imagine if I did!

Now I'd define my ApplicationResources.properties in the struts-config.xml. Only add the default because struts will find the internationalized version when the browser locale is changed.

In my jsp I call the key using:
<bean:message key="page.welcome"/>

Not sure if that helps, without looking at the app, having the issue before, or being able to replicate it examples are about all I can offer. If I missed something please let me know.
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris
what ever you have written will work fine as you have written everything using english.You have not used any letter apart from a to z .But my problem is somewhat different. I want to use the Chinies or Rusian values without converting then to UTF-8 format.
Is it possible to do so ? Please let me know that
Thanks and regards
Samir ware
 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah Samir, I see your problem. I'll check with some of my developed buddies and see if they have a quick fix.
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnaks a lot Chris for your valuable help....

 
Ashish Tahasildar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Samir,
I want to know you something.
Java dosen't understand the unicode it understand the ASCII value only
as english letter are present in ASCII so can see English properly.
This is the reason why the languages like japanese,chinese etc are converted by unicode .

Its possible to see Russian if you save your properties file as UTF-8,
but this will not overcome the problem of i18n as it will be localization.

Hope your curosity is solved.
Regards,

Ashish Tahasildar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic