Hi,
i'm trying to use the .properties files to configure my app. This is
outside of the general localization discussions and i'm running into a
few problems. i'm building an internal global tool and want to use
property files to define the specific views and attributes for each
section. in my project i have a folder called: properties and in it
there is a folder for en_US.
inside of en_US i have two folders, one for each section: UPD and BBS.
each of those folders have their own config.properties file.
the compile directives look like this: -locale=en_US
-allow-source-path-overlap=true
-source-path=properties/{locale}/UPD,properties/{locale}/BBS

in my application there is a drop down with BBS and UPD options. I
want to switch to the correct bundle when a user changes the dropdown
values. attached is the code for the dropdown and the switching.

can someone tell me how to point to the correct bundles?

Thanks,
d

Attach Code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical"
        xmlns:view="com.view.*"
        xmlns:admin="com.view.adminScreens.*">
        
        <mx:Script>
                <![CDATA[
                        import com.model.ModToolModel;
                        import mx.resources.ResourceBundle;
                        
                        [Bindable]
      private var resources:Array = [
"properties/{locale}/BBS","/en_US/UPD", "en_US" ];

                        [Bindable]
                        public var model : ModToolModel = 
ModToolModel.getInstance();
                        
                        private function comboChangeHandler():void {
        // Set the localeChain to either the one-element Array
        // [ "en_US" ] or the one-element Array [ "es_ES" ].
        resourceManager.localeChain = [ localeComboBox.selectedItem ];
        }
                ]]>
        </mx:Script> 
        
        <mx:Metadata>
                [ResourceBundle("config")]
        </mx:Metadata>
        
        <admin:CollectionList/>
        <mx:Label text="properties: {resourceManager.getString('config',
'test')}"/>
        <mx:ComboBox id="localeComboBox" 
        dataProvider="{resources}"
        change="comboChangeHandler()"
    />
</mx:Application>

Reply via email to