Hi,
I have to load an extra resource bundle in a module that gets loaded by my application. I added the following code in the module's preinitialize:
The bundle gets loaded correctly, but I have to do a kind of trick with the localeChain to force a re-evaluation so I see the updated translations. Is there a better way to force re-evaluation of the translations?Code:private function module_preinitializeHandler( event:FlexEvent ):void { var resourceBundleInfo:ResourceBundleInfo = new ResourceBundleInfo( "bundles/custom/moduleresources.properties", "moduleresources", "custom" ); var operation:LoadResourceBundleOperation = new LoadResourceBundleOperation( resourceBundleInfo ); operation.addCompleteListener( function( event:OperationEvent ):void { // Force re-evaluation of the texts now that the custom language is loaded var localeChain:Array = ResourceManager.getInstance().localeChain; ResourceManager.getInstance().localeChain = []; ResourceManager.getInstance().localeChain = localeChain; } ); operation.addErrorListener( function( event:OperationEvent ):void { Alert.show( "error loading resources: " + event.error ); } ); }
regards,
Wim


Reply With Quote