aspose file tools*
The moose likes Struts and the fly likes How to use Internationalisation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use Internationalisation" Watch "How to use Internationalisation" New topic
Author

How to use Internationalisation

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
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

Joined: Aug 10, 2006
Posts: 190
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

Joined: Jul 27, 2005
Posts: 192
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

Joined: Aug 10, 2006
Posts: 190
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

Joined: Jul 27, 2005
Posts: 192
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

Joined: Aug 10, 2006
Posts: 190
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

Joined: Jul 27, 2005
Posts: 192
thnaks a lot Chris for your valuable help....

Ashish Tahasildar
Greenhorn

Joined: Dec 10, 2006
Posts: 12
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
 
Consider Paul's rocket mass heater.
 
subject: How to use Internationalisation