This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Internationalization" Watch "Internationalization" New topic
Author

Internationalization

Pres Brawner
Ranch Hand

Joined: Jan 18, 2001
Posts: 92
Imagine this. You've got an interface that has to be translated into several languages.
Every button label, ever mnemonic/accelerator, window title, all text that is user visible.
What is your approach?
Pres
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Use Resource Bundles. This is how you do it:

The resource bundles get created this way:

You can leave the locale selection up to the user and you simply provide resource bundles with your application for all of the possible locales. Then when the user selects their locale, things like warnings and errors, component labels, status messages, etc. can all be taken from the appropriate resource bundle for the selected locale.
Pres Brawner
Ranch Hand

Joined: Jan 18, 2001
Posts: 92
Very slick!
I like this solution a lot.
Many thanks,
Pres
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Happy to help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internationalization