2

I have 3 product flavors, debug and release for each flavor, each of which I have successfully given each unique strings and icons. Now I am preparing for Localization, which requires different strings for each product flavor. Here's my current folder/directory setup:

myApp/
  src/
    main/
      res/
         values/strings.xml
    flav1Debug/
      res/
         values/strings.xml
    flav1Release/
      res/
         values/strings.xml
    flav2Debug/
      res/
         values/strings.xml
    flav2Release/
      res/
         values/strings.xml
    flav3Debug/
      res/
         values/strings.xml
    flav3Release/
      res/
         values/strings.xml

Each product flavor is already overriding the default strings.xml. Now I need my Spanish and French strings to override the default strings for each product flavor. Here's what I'm assuming my folder/directory setup needs to be:

myApp/
  src/
    main/
      res/
         values/strings.xml
         values-es/strings.xml
         values-fr/strings.xml (repeated for each flavor below)
    flav1Debug/
      res/
         values/strings.xml
    flav1Release/
      res/
         values/strings.xml
    flav2Debug/
      res/
         values/strings.xml
    flav2Release/
      res/
         values/strings.xml
    flav3Debug/
      res/
         values/strings.xml
    flav3Release/
      res/
         values/strings.xml

Can someone confirm my assumption? Then I have to find the easiest way to test it without getting stuck on a foreign language on my phone.

Thanks in advance, Devin

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
craned
  • 2,991
  • 2
  • 34
  • 38

1 Answers1

2

That structure looks right, see http://developer.android.com/training/basics/supporting-devices/languages.html.

You can also use Robotium (https://code.google.com/p/robotium/) to help automate testing to confirm.

James P
  • 36
  • 1
  • 1
    Thanks! I just wish there was a way to have my default strings for each flavor be the fall-back when they don't exist for that flavor's language, like a url. I couldn't get that to work so it's repeated for every language now. I haven't yet tried Robotium so I can't advocate it right now. – craned May 08 '14 at 16:41