You are on page 1of 5

Android Introduction

Hello Localization

@2010 Mihail L. Sichitiu

Goal
Learn how to localize an application

@2010 Mihail L. Sichitiu

/res
/res/values/strings.xml
      

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Hello, L10N</string> <string name="text_a">Shall I compare thee to a summer"'"s day?</string> <string name="text_b">Thou art more lovely and more temperate.</string> <string name="dialog_title">No Localisation</string> <string name="dialog_text">This dialog box"'"s strings are not localised. For every locale, the text here will come from values/strings.xml.</string> </resources>

/res/drawable/flag.png

@2010 Mihail L. Sichitiu

Localization
Locale Code Language/Country Location of strings.xml Location of flag.png Default de-rDE English/ UK German/Germany /res/values /res/values-de /res/drawable /res/drawable-de-rDE

fr-rFR fr-rCA en-rUS es-rVE

French/France French/Canada English/US Spanish/Venezuela

/res/values-fr /res/values-fr /res/values /res/values-es

/res/values/fr-rFR /res/values/fr-rCA /res/values/en-rUS /res/values/es-rVE

@2010 Mihail L. Sichitiu

Change the locale to


English-US Spanish-Venezuela Spanish-Spain

@2010 Mihail L. Sichitiu

You might also like