[ResourceBundle("application")]
private var rb:ResourceBundle;
[ResourceBundle("application_de")]
private var rb_de:ResourceBundle;
[ResourceBundle("application_es")]
private var rb_es:ResourceBundle;
[ResourceBundle("application_fr_CA")]
private var rb_fr_CA:ResourceBundle;
[ResourceBundle("application_fr")]
private var rb_fr:ResourceBundle;
I stick all this into a static class so I can do something like Translations.get("myKey");
In my last post I discovered that the rb_fr variable was null. And if I switch the order of the rb_fr and the rb_fr_CA definitions in my code, then the rb_fr_CA variable would be null. I initially thought it had something to do with the naming. Possible related to the underscore character. After pulling my hair out I discovered that it isn't that. In fact which ever one is defined last is null. So if I add another one to the end it will be null and all previous ones work. The strangest part of all this is that if I do the same thing direction in my Application instead of in a Module, the problem doesn't seem to exist.
In the end all this probably is a moot point since Flex 3 will give us the ability to do runtime locale changes, which is really what I was trying to accomplish. I really didn't want to have to compile my application 5 times; once for each locale.
2 comments:
Still worth filing a bug at http://bugs.adobe.com/flex :-)
So how did you fix it anyway? I am currently having the exact same problem, and I don't use modules, just static class inside the application with series of [ResourceBundle] (I have 17 of them). Sometimes I get 12 of 'em working, sometimes 15, but never all 17. Could you share your solution please?
Post a Comment