4 Replies Latest reply on Jul 8, 2011 11:43 AM by Piotr Wierzgała

    localization

    Piotr Wierzgała Level 1

      Hi,

       

      I'm writting a Flex-PHP application where PHP passes locale string (e.g. fr_FR) to Flex using flashvars. The problem is that I don't know for how many languages my app will be localized. If I pass to Flex locale string which was not specified in compiler options I get error:

       

      ReferenceError: Error #1069: Property -1 not found on __AS3__.vec.Vector.<flash.display::DisplayObject> and there is no default value.

       

      Could anyone tell me why I need to copy locale (in {SDK_folder/frameworks/locale}) and have all locales specified at compilation stage?

      Is there any way to add localisations dynamically? And I don't mean specyfing localisation strings by that (I already managed to do that).

        • 1. Re: localization
          Flex Rock Level 1

          Hi,

                You doesn't need to specify all the locales in compilation. But the thing is you need to have all the locale files which ever you specify should be there in

          {SDK_folder/frameworks/locale}. Because whenever you specify a locale it will look in to this folder {SDK_folder/frameworks/locale} whether the locale specifed is supported by flex or not. If it is not there it will throw error. Thats why you are getting the error.

           

          Regards,

          Jayagopal.

          • 2. Re: localization
            Piotr Wierzgała Level 1

            Actually i get this error:

            "ReferenceError: Error #1069: Property -1 not found on __AS3__.vec.Vector.<flash.display::DisplayObject> and there is no default value."

            when I'm trying to set resourceMagager.localeChain = ["xx_XX"] and xx_XX is not specified in compiler options.

             

            If I specify xx_XX in compiler options and do not create {SDK_folder}/frameworks/locale/xx_XX resource then I get error:

            "Unable to open '{SDK_folder}\frameworks\locale\xx_XX' {Application_name} Unknown Flex Problem"

            In my app I'm creating localized resources dynamically what means that I'm doing it by reading a XML file containg key-value items at runtime. When I try to set resourceMagager.localeChain = ["xx_XX"], where xx_XX is not specified in compiler options, my app stops working (e.g. it doesn't load images). I can't understand why I'm limited in such way? Why do I need to specify locales in compiler options to make my app work properly even if I create localized resources dynamically?
            Does anyone know why Flex needs to have all used locales in {SDK_folder}\frameworks\locale\? For me it looks like unnecessary complication.

            • 3. Re: localization
              Flex Rock Level 1

              Hi,

                  In this resourceMagager.localeChain = ["xx_XX"] you are trying to give some language right. So if you are specifying a language it should be supported by flex. Means the swc files required for localization of that language should be there in {SDK_folder/frameworks/locale} then only it will localize that language. Otherwise it will throw an error. Thats what i said in last reply itself.

               

               

              Regards,

              Jayagopal.

              • 4. Re: localization
                Piotr Wierzgała Level 1

                Thanks for your reply,

                 

                I understand the things you wrote, I know how to use localization. My question was about organization of localization process and  maybe it was a little to deep. I wanted to know why exactly flex needs to have that "swc files required for localization". Why are they required? What is their function?

                 

                Anyways I created all requierd locales and from the view of my project it's not a problem any more.