Question

I'm doing a multi language program, it have different language include the hebrew & romana.

I'm having few problem with the Capability.language, it returns Error or null when I change the device language to hebrew or romana and set English as default language, I need to know the device language to print some images that they are associate to the Currency ISO Codes by Country and I can know it with the device language. So how can i know the language device (it's an android device and the program is a Flex program with AIR) when they're hebrew or romana.

Thanks

Was it helpful?

Solution

Capabilities.languages returns an array of languages in the preferred order. So if you do this:

var prefLang : String;
var langs : Array = Capabilities.languages;

Then check if it is there:

 if(langs) {
        // your preferred language is the first one
        prefLang = langs[0];
   } else {
      prefLang = Capabilities.language;
   }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top