This content has been marked as final. Show 6 replies
Does anyone have any ideas to help me with this??? I could reallys use the help with this
First off, read "Localizing Flex Applications" in the Flex Developer's Guide. It explains the ResourceBundle implementation in Flex. To put it very simply (but don't take this as a substitute for reading the docs):
1. You create /locale/ subfolders for each locale (e.g. en_US for US English, fr_CN for Canadian French, etc)
2. In each folder you place a set of .properties files containing the appropriately translated text
3. You add metadata tags in your application code, associating the files with ResourceBundle classes
4. You use the -locale (I think, check the doc) compiler option to compile one version of your app for each locale
It's the last step that's kind of a gotcha for some folks (like me). Some people are using this framework and loving it; others have rolled their own to support run-time loading of resources. Run-time loading will be incorporated with Flex 3, but until then, if you either need to avoid creating or serving one SWF for each locale, or if you need to switch locales at runtime, you'll need to implement your own solution.
Keep in mind that you probably need to deal with dates, currencies and number formats as well. I had a very informative exchange with Gordon Smith from the Flex team on flexcoders
Last thing: If you implement your own, I would recommend sticking as closely as possible to the Flex implementation pattern so you can adopt the run-time loading in Flex 3 without too much trouble. This also includes formatting resource bundle files as simple property sheets (name=value pairs), rather than XML--I agree that XML is too heavy handed for such a simple structure, and it's easy to build a property sheet parser in AS3.
Hope that helps,
where do i plae this /locale/subfolders for each language??? and does anyone have any sample .property folders for these that i could see so i know what is going on a little better thanks for all the help again
Again, you really need to read the chapter in the developer's guide on localization. That will answer your questions about where resource files can go. (Short answer, anywhere in your classpath, but you probably want to put them under a common locale folder).
Check in the flex-sdk /frameworks/locale folder for examples; these are the resources that the framework itself uses.
thanks for all your help...