A while ago, I had what sounds like the same situation you have now in an English-Spanish project.
I have two ArrayCollections (one in each language) of keywords that populate a ComboBox. When the locale changes, the dataProvider = the appropriate keyword list.
Note that I am not a professional programmer/developer. At the time I dealt with this issue, I got advice from a couple of the gurus in these forums; the consensus was that there is nothing wrong with manipulating the dataProvider in this fashion.
If you wish, browse to http://www.timos.com/timos/green/ct/CounterThink.cfm and see this in action.
Thanks for replying.
Your workaround is probably suitable for small applications with 2 languages at most.
In my case, I have to deal with a large applications with several languages.
I can't imagine having to declare a dataProvider for each language ... definately not a scalable solution
Try using ResourceManager API in Flex. Check the Adobe help site for details.
Can you be a bit more specific please? I'm already using ResourceManager in my example.
Kap, don't take me too literally. I gave your example code a closer look. It appears that you have the text for the CB labels in a resource bundle: I would see that as a nightmare – I hope I am wrong and that you have all that data in some kind of dataset; I have mine in a DB table.
Picture this: when the app starts, you bring the data into an array, let's call it rawData. Then you declare an AC called, say, 'datesAC' and populate it by filtering rawData, for the current locale. Each time the locale changes, you extract the right data from rawData, populate datesAC with that data, sort it and refresh it. Your ResourceBundle does not enter into this picture.
So you don't actually declare a dataProvider for each language: all you have to deal with are rawData and datesAC; datesAC has to change each time you change the locale regardless of how you set this up.
HTH. If you want more details, I'll be happy to provide them.