Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art
Introduction: InternationalizationBack to Android Cookbook Home | Up to Chapter: Strings and Internationalization

Author: Ian Darwin ('idarwin')
In Published Edition? Yes
FormatLanguage: WikiFormat

Introduction: Internationalization


"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.

If you've got your Strings in a separate XML file as we advised in Chapter 1, Getting Started, you have already done part of the work of Internationalizing your app. Aren't you glad you followed our advice?

Android provides a Locale class to discover/control the internationalization settings. A default Locale is inherited from the user's Language settings when your App starts up.

Note that if you know Internationalization from Desktop Java, it's pretty much the same. We'll explain as we go along, with examples, in this chapter.

Ian's Basic Steps: Internationalization

Internationalization and localization consist of:

There are examples of doing these things in the Recipes of this chapter.

See Also

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