3

Based on the Android documentation :

I have created a ressource file for the zh locale : screenshot

And I have started two emulator: one using english as locale, and one using zh_TW_#Hant.

And yet, every strings are in english.

I tried to follow the Android documentation, but it is not working so I assumed my configuration is wrong. I restarted devices, and checked the files many times. What could be wrong ?

Is there a way to know if the system is looking for the zh ressource and failed to find it, or if it immediately looking for the default one ?

Edit: I have tried the following configurations :

  • using values-zh/ instead of values-b+zh/ for the phone in zh_TW_#Hant still loads the default strings.
  • all Locales on emulators are changed through the phone settings.
  • using values-es/ and a phone in Spanish works perfectly.
  • using values-zh-TW/ for the phone in zh_TW_#Hant works !

So the issue I don't understand is why the Spanish+Region loads the es file, whereas the Chinese+Region does not load the zh file ?

NoonanRosenblum
  • 481
  • 5
  • 18
  • 2
    Try using `values-zh/` instead of `values-b+zh/` and see if you have better luck. You should be able to use `Locale.getDefault()` to see what your process sees as being the requested language. – CommonsWare Jul 21 '18 at 22:41
  • In the emulators, I have found that using the "Custom Locale" tool they provide and specifying something with a country code often doesn't work. Going to the regular Android language settings ("Settings -> Language & Input -> Language") and setting it there works in those cases. – Tyler V Jul 21 '18 at 22:48

0 Answers0