Android本地化应用开发教程
本节我们尝试将 L10NDemo 实例本地化。为 L10NDemo 工程添加汉语、德语、日语、英语支持。
语言_国家和为其所建立的资源文件夹的对应关系如表 1 所示。
Locale Code | Language/Country | Location of strings.xml | Location of flag.png |
---|---|---|---|
Default | Chinese/china | res/values/ | res/drawable/ |
zh-rCN | Chinese/china | res/values-zh-rCN | res/drawable/ |
fr | French/France | res/values-fr/ | res/drawable-fr/ |
ja | Japanese/Japan | res/values-ja/ | res/drawable-ja-rJP/ |
en-rUS | English/United States | (res/values/) | res/drawable-en-rUS/ |
1)在 res 目录上右击,选择 New | Android XML File,如图 1 所示。在弹出的对话框中设置 Resource Type 为 Values、Project 为“DailyLog”、文件名为“strings.xml”,然后单击 Next 按钮。