Link to home
Start Free TrialLog in
Avatar of Persepy
Persepy

asked on

MultiLanguage

Hi there,

  Actually I'm very keen to know how can I implement multilanguage in java environment.I hope I can get a overall picture/rough idea on how I should proceed in implementing it.Examples would be helpful to me if there any.
 
Avatar of Venci75
Venci75

check this:
http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html

you can take your strings from a properties file. By changing the locale - the appropriate values will be loaded
Avatar of Persepy

ASKER

Thanks Venci75,reading from a properties file is one way to do it.
Avatar of Persepy

ASKER

I would like to view if there is any other interesting ways to do it.
you can create Java class file with different messages as public static final constants like:

public class English {
  public static final GOOD_MORNING = new String("Good Morning");
  //... other constant ...
}

public class French {
  public static final GOOD_MORNING = new String("Bon Jour");
  //... other constant ...
}

etc. This will make things very fast. When you have to say Good Morning in English, just print English.GOOD_MORNING
It may also be relevant to know about slangsoft. It is an Israeli company that produces software that provides serverbased localization. That is, clients hook up to a server and run applets that provide localization without any involvement on the clients part. They also provide other forms of course. They are at the obvious URL: http://www.slangsoft.com .
ASKER CERTIFIED SOLUTION
Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
 ... and another one: http://www6.software.ibm.com/developerworks/education/j-i18n/index.html (hopefully it is not the same with any of these that jim_cakalic suggested).

  Hope it helps.
You can find a sample chapter of the OREILLY book "Java Intrenationalization at the oreilly page. It speaks about ResourceBundles.

www.oreilly.com/
Anybody, any comments on my idea of using CLASS files?
What about the french characters with accent graves etc...

Are you going to write them according to their unicode number ?
Avatar of Persepy

ASKER

If I have to support multi-byte for eg. chinese,japanese or etc,would be better if I store in database.I believe is a bit hard if I used properties file.Any comment?
Dont think there is any difference in file and database w.r.t the language
We used to have a project as Persepy describer by using ResourceBundles,we have several property files for different languages.
It is simple and works well!
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- split points between Venci75 and jim_cakalic@idg

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
OK by me. :-)
Jim