This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one 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 Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 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