Skip navigation
Currently Being Moderated

Does anyone have the Country codes that iPhone/iPad understands

Jan 16, 2013 7:01 AM

Tags: #as3 #iphone #ipad #locale #country_code

I'm Locale,izing my app - and suddenly bump into the problem that on the iPhone and iPad plaforms, and Mac for that matter - Apple use slightly different sets of the ISO standards. Or at least their own interpretations of them.

 

https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptu al/BPInternational/Articles/LanguageDesignations.html

 

Now if I go ahead and use the Strings option in CS6 Flash Pro, it fundamentally has the basic for example 'en' and if you want the versions of 'en-US' or 'en-GB' or 'en-AU' ... you have to add them in the custom field. There is also the Chinese variants, detailed in the llink above and no doubt many others.

eg;

 

zh-Hans

Chinese in the simplified script.

zh-Hant

Chinese in the traditional script.

 

So what would be really handy, is a list of the actual contry codes returned from an iPhone4 and 5 - yes, they are different apparently, and the various iPad models.

Does anyone have such a list that they have generated? of where it can be found. I've trawled all over apple and the web and the variants are in their thousands ...

thanks

 
Replies
  • Currently Being Moderated
    Jan 16, 2013 8:44 AM   in reply to rachalmers

    The 2-letter 639-1 column is what it should be following:

    http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 6:16 AM   in reply to rachalmers

    In your "Can't do this" example you spelled it "myTxt" while the static var is "my_txt" so you'd need to correct that.

     

    If you're assigning this outside the class you will need to specify the class to access the data.

     

    e.g.

     

    package

    {

         public class SomeClass

         {

              public static var myStr:String = "Hello World";

     

              // access even in the same class

              trace(SomeClass.myStr);

         }

    }

     

    // assign outside of class (do not instantiate)

    myBtn.label = SomeClass.myStr;

     

    If you want to set it you should use a proper setter with validation inside SomeClass:

     

    public static function SetMyStr(str:String):void

    {

         // sent null, disregard

         if (!str) { return; }

     

         // didn't send null, set myStr

         SomeClass.myStr = str;

    }

     

    Used:

     

    // only static members can use other statics

    SomeClass.SetMyStr("A new string");

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 12:22 PM   in reply to rachalmers

    Doesn't matter how long any of us have been at it, a little trial and error happens every single project . Glad you got it working. You're welcome and good luck!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 20, 2013 8:25 AM   in reply to rachalmers

    I don`t understand why you don`write sth like

     

    function localeCallback(success:Boolean):void {

    tiAddress.text = Locale.loadString("IDS_002");

    btnGPS.label = Locale.loadString("IDS_007");

    }

     

    Also: If you mark a thread prematurely as correct, it is better to start a new one and link the related threads in the header or sth.

    Your chance of getting advice would inrease.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points