Java Reference
In-Depth Information
Chapter 11
Parlez-Vous Français?
Making It Multilingual
The webmail application is shaping up nicely. With its crisp design,
amazing set of features, and outstanding user friendliness, the calls
have been pouring in asking for its release to the public. Users from all
over the world will be using the application! With such global exposure,
it'd be nice to offer the interface in different languages. In this chapter,
we'll discuss everything related to making an application available in
more than one language, and we'll be translating the webmail applica-
tion to French as an example.
11.1
Offering an Application in Multiple Languages
Several tools are at your disposal for making the translation of an appli-
cation into other languages as painless as possible. At the heart of the
process are Java's Locale and ResourceBundle classes. A locale repre-
sents a language, a country, a region, a culture. . . everything you would
consider when you want to present information to a user in the manner
that's most natural for them. A resource bundle contains all the locale-
specific information and isolates it from the rest of the code. This makes
it easier not only to support multiple languages but also to add more
languages later.
Locales and Resource Bundles
A locale is represented by several parameters, but let's keep things sim-
ple and just use the language. Languages are represented by two-letter
 
 
 
 
Search WWH ::




Custom Search