Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Giving Multilangual support  RSS feed

 
Gauhar Khan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i want to give multilanguage support in a web application...i am using Resource Bundle and Localization classes for this...and I read the String values from the ResourceBundle(Property file)
So if i want to give Chinese Language support what characters i should specify in the resource file as a value of the key?

e.g
say my resource file is Resource.properties....
It contains key value pairs as
Hello(as key) ???(Value)

so in case of Chinese what characters i have to specify...

I am using English version of WindowsXP....
 
leon fan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should provide a seperately property file for other locale such as chinese locale:

en resource file: Resource.properties
chinese resource file: Recource_zh_CN.properties

In chinese resource file, you should include all key same as in english file and its' chinese value.

Then, in you program, you need give property file's base name and user's prefer locale to initial ResourceBundle:

ResourceBundle bundle = ResourceBundle.getBundle(Resource, client_locale)
 
Jeffrey Spaulding
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm not sure if i do it the easy way, but my properties
file looks like this:



Otherwise i experienced all kinds of problems with
the actual use of the localized strings.

To convert the characters in the ucn notation i used an editor
called babelpad.

J.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!