aharui commented on issue #824:
URL: https://github.com/apache/royale-asjs/issues/824#issuecomment-629744758


   This test case indicates to me that locale changes do in fact update the XML.
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.apache.org/royale/spark"
                           xmlns:mx="library://ns.apache.org/royale/mx"
                           paddingBottom="0" paddingTop="0" paddingLeft="0" 
paddingRight="0"
                           creationComplete="init()"
                           height="100%" width="100%" 
                           >
        <fx:Metadata>
                [ResourceBundle("containers")]
        </fx:Metadata>
        
        <fx:Script>
                <![CDATA[
                        
                        import mx.resources.ResourceManager;
                        import mx.collections.XMLListCollection;
                        import mx.events.FlexEvent;
                        import mx.events.MenuEvent;
                        
                        
                        [Bindable]
                        public var menuBarData2:XMLListCollection = new 
XMLListCollection();
                                
                        protected function 
creationCompleteHandler2(event:FlexEvent):void
                        {
   
                                var roleInfo:String = "ADMIN";
                                
                                var tmpXmlList:XMLListCollection = new 
XMLListCollection();
                                tmpXmlList.source = menuDataXMLList;
                                
                                menuDataXMLList = tmpXmlList.source.copy();
                                
                                menuBarData2.source = menuDataXMLList;
                                
                                menuBarData2.refresh();
   
                        }
                        
                        protected function 
itemClickHandler(event:MenuEvent):void {
                        }
                        
                        private function init():void {
                                resourceManager.localeChain = ["en_US"];
                        }
                        
                        [Bindable]public var switchLocale:String = "Switch 
Locale";
                        
                        private function changeLocale():void {
                                var locale:String = 
resourceManager.localeChain[0];
                                if(resourceManager.localeChain[0] != "en_US") {
                                        resourceManager.localeChain = ["en_US"];
                                } else {
                                        resourceManager.localeChain = ["es_ES"];
                                }
   
                                trace(menuDataXMLList.toXMLString());
                                
                                /*                              
                                var newDP:XMLListCollection = new 
XMLListCollection(menuDataXMLList);
                                menuBarData2 = newDP;*/
                                
                        }
                        
                        
                        private function dummyMethod(event:MouseEvent):void {
                        }
                        
                ]]>
        </fx:Script>
        
        <fx:Declarations>
                <fx:XMLList id="menuDataXMLList">
                        <menuitem label="label-1">                      
                                <menuitem label="label-1-1"/>                   
                                <menuitem label="label-1-2"/>                   
                        </menuitem>
                        <menuitem 
label="{resourceManager.getString('containers', 'noColumnsFound')}" id="admin" 
>                      
                                <menuitem label="label-2-1"/>                   
                                <menuitem label="label-2-2"/>                   
                                <menuitem 
label="{resourceManager.getString('containers', 'noRowsFound')}" id="admin" />
                        </menuitem>
                </fx:XMLList>
        </fx:Declarations>      
        
        <s:layout>
                <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" 
paddingTop="10" paddingBottom="20" />
        </s:layout>
   
        <s:Button label="{resourceManager.getString('containers', 
'noRowsFound')}" click="changeLocale()"/>
        
   </s:Application>
   ```
   
   Does this not output the changed strings for you?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to