2 Replies Latest reply on Jan 19, 2011 8:49 PM by prethi.flex

    Runtime localization in AIR fails

    prethi.flex Level 1

      Hi All

       

                i am trying to load system locale in AIR.

       

      code : initializeHandler(event:FlexEvent)

       

                var locales:String=Capabilities.languages.toString();

                locales=locales.replace(/-/g,'_')

       

       

                resourceManager.localeChain=[locales];

       

       

      Set the project properties as [additional complier argument] -locale de_DE -source-path=../locale/{locale} and the system language is en_US.

      If i run this project am getting a blank labels.am getting a blank labels when i set value to resourceManager.localeChain.Its working perfectly in static builds.

       

      Thanks in advance ..please help me..

       

      Preethee

        • 1. Re: Runtime localization in AIR fails
          Grace_Wang

          Hi Preethee,

           

          I can see some conflicts in your sample code. Could you please try with following one? It works fine for me.

           

          var locales:Array = Capabilities.languages;

                         

                          for (var i:int = 0; i<locales.length; i ++)

                          {

                            var index:int = i;

                            locales[index] = locales[index].replace(/-/g,'_');

                            trace ("locales:" + locales[index]);

                          }

                          resourceManager.localeChain = locales;

           

           

          AIR Engineering

          Grace Wang

          • 2. Re: Runtime localization in AIR fails
            prethi.flex Level 1

            Thanks Grace Wang,

             

                Now its working for me.i set -locale de_DE -locale en_US -source-path=../locale/{locale} in properties compiler argument and assign the system locale in localechain.

             

             

            Regards

            Preethee