Mega Code Archive
Print the keys and values for all resource bundles in all locales in the ResourceManager
import mx.resources.ResourceBundle;
import mx.controls.Alert;
private function registrationComplete():void {
/* Use the ResourceManager to set localized values in ActionScript. */
Alert.show(resourceManager.getString('RegistrationForm', 'thanks'));
}
private function enumerateBundles():void {
for each (var locale:String in resourceManager.getLocales()) {
ta1.text += "****************************************\n";
ta1.text += "locale: " + locale + "\n";
ta1.text += "****************************************\n";
for each (var bundleName:String in resourceManager.getBundleNamesForLocale(locale)) {
ta1.text += " --------------------------------------\n";
ta1.text += " bundleName: " + bundleName + "\n";
var bundle:ResourceBundle =
ResourceBundle(resourceManager.getResourceBundle(locale, bundleName));
for (var key:String in bundle.content) {
ta1.text += " -" + key + ":" + bundle.content[key] + "\n";
}
}
}
}
[ResourceBundle("RegistrationForm")]