Naming the Folders for Localized Resources

The XML resource files containing localized strings are placed in subfolders of the project’s res folder. Android uses a special folder-naming scheme to automatically choose the correct localized resources—for example, the folder values-fr would contain a strings.xml file for French and the folder values-es would contain a strings.xml file for Spanish. You can also name these folders with region information—values-en-rUS would contain a strings.xml file for United States English and values-en-rGB would contain a strings.xml file for United Kingdom English. If localized resources are not provided for a given locale, Android uses the app’s default resources—that is, those in the res folder’s values subfolder. ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.