Locale works fine on desktop - just not on the iPhone


the following code - simple can make it, runs fine on desktop in iphone simulator. - transfer iphone. , that's it. shows blank labels - indeed, puts word 'label' labels.

no errors, nothing. doesn't work on device.

 

to i'm disappointed in adobe documentation locale. understatement.

ie.

getdefaultlang() goes example setdefaultlang() .... no mention of getdefaultlang()  until 4th line - doesn't work if trace on it.

 

initialize() has typagraphical error in first line of sample code. example description confusing least "instead of using initialize() method directly, use string replacement method of "automatically @ runtime" proceeds after incorrect trace statement give both methods in 1 example.

 

 

with locale.loadlanguagexml, unless set path - load on own doesn't work - because cant find files in created sub directories.

 

very frustrating....

 

if has working on iphone/ipad, i'd love hear it, , see code using if cares share.

 

 

var loc:string = null;

                              loc = flash.system.capabilities.language.substr(0, 2);

 

                              trace("the default language: " + loc);

                              locale.setloadcallback(localecallback);

                              locale.addxmlpath(loc, loc + "/pinpointpremium_" + loc + ".xml");

                              locale.loadlanguagexml(loc);

 

 

           function localecallback(success:boolean):void {

                                        if (success){

                                                  btnaddress.label = locale.loadstringex("ids_001",loc);

                                                  tiaddress.text = locale.loadstringex("ids_002",loc);

                                                  btndirection.label = locale.loadstringex("ids_005",loc);

                                                  btntwitterusernp.label = locale.loadstringex("ids_006",loc);

                                                  btngps.label = locale.loadstringex("ids_007",loc);

                                        } else {

                                                  trace("unable load language file.");

                                        }

           }

 

being language code on devices can different , non-spec-abiding , did work of specifying loc , xml it, try using loadstring instead of loadstringex (which gets "what device think locale is" again).

 

e.g.

 

btnaddress.label = locale.loadstring("ids_001");

// etc



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

uppercase letters in url - Joomla! Forum - community, help and support

Joomla! Update is not offering Joomla 3 - Joomla! Forum - community, help and support