3

Per Android Locale documentation:

Note that Java uses several deprecated two-letter codes. The Hebrew ("he") language code is rewritten as "iw", Indonesian ("id") as "in", and Yiddish ("yi") as "ji". This rewriting happens even if you construct your own Locale object, not just for instances returned by the various lookup methods.

Without duplicating files, is there a way to support both the deprecated and official language code when creating an app?

My current situation is that there is one user who's phone uses "he" whereas most others use "iw". I (naively) tried working around the problem using two approaches - both failed.

  1. Creating a link in the directory structure so that values-he will link to values-iw. As could have been expected, Eclipse saw this as a lnk file
  2. Using code to manually switch one coding to another (if (lang.toLowerCase(Locale.US).equals("iw")) { lang = "he";}). After reading the documentation above, it is clear that this approach won't work either.

Per this question (and according to the documentation) I am surprised to see this problem arise in the first place as I would assume that "iw" would always be used; however this is not the case.

Community
  • 1
  • 1
levengli
  • 1,091
  • 7
  • 18

0 Answers0