This content has been marked as final. Show 9 replies
You need to localize the framework resource files using this ant script:
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\build.xml
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\locale\en_US\framework_rb.swc
C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\framework\bundles\en_US\src\validators.properties
While you are at it, locallize all the .properties files there, otherwise if you use date controls your months, days, etc. will be messed up, wrong decimal separators will be used etc.
See this FB3 help topic and sub-topics:
Editing framework resource properties
Localizing Flex Applications
I copied the validators.properties file in my fr_FR project folder, changed the strings and it worked. But I also have strings in a constants.as file.
The resourceManager.getString is linked to components which a as file doesn't have. I tried extending my class with UIComponent but i keep getting this message: 1178: Attempted access of inaccessible property resourceManager through a reference with static type mx.core:UIComponent. Here's an example:
of what I'm trying to accomplish:
Even with the import mx.resources.ResourceManager I get the 1178: Attempted access of inaccessible property resourceManager through a reference with static type mx.core:UIComponent.
We can't seem to be able to use "resourceManager.getString("xxxx","yyyyyy"); in an .as file. Because we have a bunch of strings to be translated in an .as file i need to get this to work.
Thanks in advance
Why are your strings translated in an .as file? Why are they not in .property files?
We created a contants.as file where we define countries, states, provinces etc. These strings are put in arrays like in the example above to populate our controls. There must be some way to fetch strings other than in a mxml??
Thanks for your time
I would put those strings in a .properties file and then you should be able to access via resource bundles. You never want hard coded data in .as files. Always store it in .properties files or in XML files.
Ok we'll transfer the strings in a properties file like this : states = Alabama;Alaska;Arizona.......and parse them to still be able to use lists to populate the controls.
Or if you ever need the abbreviations, just have a states.properties file, with these entries:
MA = Massachusetts
CA = California