Skip to main content
Inspiring
October 30, 2013
Question

localeID

  • October 30, 2013
  • 1 reply
  • 425 views

I have got this working:

var languageSettings:Array = Capabilities.languages;

var locale:String = languageSettings[0].toString().toLowerCase();

to tell me my iphone is in language "en"

but I want to know if it is in "en-us" or "en-gb"

I understand this can be done using LocaleID

but how do I use it?

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
October 30, 2013

Try setting your phone to British English, then I think Capabilities.languages[0]; will give you “en-GB”.

joeboy_ukAuthor
Inspiring
October 30, 2013

thanks colin, i just saw that as you posted and I used this code

var languageSettings:Array = Capabilities.languages

var locale:String = languageSettings[0].toString().toLowerCase();

var loc:LocaleID = new LocaleID(locale);

var myLocale:String=loc.getRegion()

trace(myLocale)

seems myLocale now gives me GB

thanks