aharui commented on issue #824: URL: https://github.com/apache/royale-asjs/issues/824#issuecomment-629589422
I would not choose remote debugging unless I could not reproduce the problem locally. I think most people want the simplest test case possible that can run locally when debugging. In fact, I would prefer that your test cases do not use resources unless it truly is a bug in the ResourceManager. I think the ResourceManager is now working and using resources just adds complexity to the test case. I have to take time to simplify the test case as I do not have the resource bundle handy. It is often simple enough to test just by replacing strings at runtime. Here is the simplified test case I used: ``` <?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: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 = ["tr_TR"]; }*/ switchLocale = "Locale Switched"; 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="{switchLocale}" id="admin" > <menuitem label="label-2-1"/> <menuitem label="label-2-2"/> <menuitem label="{switchLocale}" 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="{switchLocale}" click="changeLocale()"/> <mx:MenuBar id="menuBar_fx_Declarations" width="100%" dataProvider="{menuBarData2}" horizontalCenter="0" itemClick="itemClickHandler(event)" labelField="@label" creationComplete="creationCompleteHandler2(event)"/> </s:Application> ``` ---------------------------------------------------------------- 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]
