O'Reilly logo

Java Cookbook, 2nd Edition by Ian F Darwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Internationalization and Localization

Introduction

"All the world's a stage," wrote William Shakespeare. But not all the players upon that great and turbulent stage speak the great Bard's native tongue. To be usable on a global scale, your software needs to communicate in many different languages. The menu labels, button strings, dialog messages, titlebar titles, and even command-line error messages must be settable to the user's choice of language. This is the topic of internationalization and localization. Because these words take a long time to say and write, they are often abbreviated by their first and last letters and the count of omitted letters, that is, I18N and L10N.

Java provides a Locale class to discover/control the internationalization settings. A default Locale is inherited from operating system runtime settings when Java starts up and can be used most of the time!

See also Java Internationalization by Andy Deitsch and David Czarnecki (O'Reilly).

15.1. Creating a Button with I18N Resources

Problem

You want your program to take "sensitivity lessons" so that it can communicate well ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required