简体   繁体   中英

Android localization resources

I have just finished developing an android application that I was asked to make. I had also planned to translate it in different languages; below you can see the tree of the folders/files:

在此输入图像描述

Inside strings.xml there are all the values that I am using inside the classes and they are all in Italian, my language ( Here you can see an example if needed). I'd like to be able to translate all those fields in English and french as well.

I have read this article -> http://developer.android.com/training/basics/supporting-devices/languages.html

From what I have understood, I'd have to create a folder called values-fr with a strings.xml inside (it will have the same values names, but different translations).

QUESTION

I would like to be able to support English and Italian as well, but I don't understand how to manage the folders. Could you please tell me which option is the correct?

  1. Inside the folder values use strings.xml with Italian (my language) strings. Then create another folder called values-en and, like I did before, create strings.xml with English values
  2. Inside the folder values use strings.xml with English strings. Then create another folder called values-it and then, create strings.xml with Italian values

I guess that the point 2 is the correct solution but I'm not sure. The folder values has English as default language?

Thanks for the attention.

Technically speaking both are valid. values/ is the fallback if a more specific qualifier is not found. There is no written rule that enforces you in having the English strings in values/ . It just makes a little more sense to have the English as fallback since it easier to find foreigners that speak English rather than Italian

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM