How to Create Alternate Resources

A large part of localizing an application is providing alternate text for different languages. In some cases you will also provide alternate graphics, sounds, layouts, and other locale-specific resources.

An application can specify many res / <qualifiers>/ directories, each with different qualifiers. To create an alternate resource for a different locale, you use a qualifier that specifies a language or a language-region combination. (The name of a resource directory must conform to the naming scheme described in Alternate Resources, or else it will not compile.)

Suppose that your application's default language is English. Suppose also that you want to localize all the text in your application to French, and most of the text in your application (everything except the application's title) to Japanese. In this case, you could create three alternate strings.xml files, each stored in a locale-specific resource directory:

0 0

Post a comment