Categories
Articles

Adobe Flex Localization Dynamically Loaded Resource Modules

I followed the example at  Adobe Labs written by Gordon Smith September 25, 2007 to create a basic language localization example that would load the locales dynamically at runtime.

I had some bumps in making the example work in that it did not load the language when launched. This could be due to differences in the  version Gordon was using or just those nasty timing issue you get in the Flex framework. The basic issue was to add an initialization event handler to the example and the line resourceManager.localeChain=[“en_US”]; in it.

However Gordon’s tutorial was essential to understanding the geekish implementation of Flex dynamic localization. You have the copylocale utility program to run in the Flex sdk bin folder to set up Flex for each language. I created a windows batch file for it and included in my example. It makes it easy to add a language to Flex at a later date with a simple copy and edit.

Flex uses a separate swf for each language to load them at run time. You create these with command line steps using the mxmlc compiler and lengthy arguments. Since you have to do this every time a language item changes, I again created some batch files to automate the process.

The completed example is located at Adobe Flex 3 Basic Locales Dynamic Runtime Localization With Resource Modules.