4

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:

enter image description here

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.

5
  • both are valid. values/ is the fallback. Decide what's your fallback and be consistent. Commented Dec 27, 2015 at 15:16
  • So if I kept values in italian and I created values-en (with its relative strings.xml), it would be correct? Commented Dec 27, 2015 at 15:18
  • 1
    yes, there is no rule that enforces you in keeping the english file into values/ Commented Dec 27, 2015 at 15:21
  • Ok thank you, got it :) Could you post an answer? so I can upvote Commented Dec 27, 2015 at 15:22
  • 1
    like the way you have asked a question. Properly formatted and properly described. Commented Dec 27, 2015 at 15:26

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I have thought the same. I am using values/ in English because it's more known that italian. I will create a values-it/ and values-fr/. Thank you! :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.