changing locale

28 views
Skip to first unread message

fpirotti

unread,
Mar 12, 2012, 3:28:40 AM3/12/12
to openscales-dev
Hello List,
Congratulations to the OpenScales Team for the new versione.
I am in need of a tip, I just could not figure out how to change the
language from US locale to FR locale. I am implementing an Italian
locale (IT.json) and I have added it to the Map.as file as i18n
module. I am missing the part where I assign it as "activeLocale"...
where do I do that?
Cheers,
Francesco

Hadrien TULIPE

unread,
Mar 14, 2012, 5:39:38 AM3/14/12
to opensca...@googlegroups.com
Hi Francesco.

Thanks for using openscales

Here is how to add a new locale:

First, declare your JSON (as you may have done):


        import geoportal.i18n.provider.I18nJSONProvider;

        [Embed(source="IT.json", mimeType="application/octet-stream")]
        private const ITLocale:Class;
        
        public function onCreationComplete():void
        {
            I18nJSONProvider.addTranslation(ITLocale);
            myMap.locale = Locale.getLocaleByKey("IT").localeKey;
        }
Here, creationComplete is a callback on your application's creationCompleteEvent and IT.json is your italian translation file. myMap is your application map.

Regards


Hadrien Tulipe


2012/3/12 fpirotti <francesc...@unipd.it>

--
You received this message because you are subscribed to the Google Groups "openscales-dev" group.
To post to this group, send email to opensca...@googlegroups.com.
To unsubscribe from this group, send email to openscales-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openscales-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages