0 Replies Latest reply on Dec 31, 2007 5:39 AM by Jens Eckervogt

    Problem with Resource.bundle and MenuBar Component

    Jens Eckervogt
      Hello guys,

      I wish to know that resource.bundle once MenuItem. If i change my correct Language German.

      But it can't work locale on the MenuItems. Why? I believe, that you Adobe Inc will to joke or not?? :(
      I do not understand.
      Sample : I have written this code:
      with m@Resourcent like Panel:
      quote:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="480" height="74" cornerRadius="5" borderStyle="solid" backgroundColor="#E7E7E7" alpha="1.0" backgroundAlpha="0.5"
      creationComplete="initCollections();">
      <mx:Metadata>
      [ResourceBundle("myResources")]
      </mx:Metadata>
      <mx:Script>
      <![CDATA[

      import mx.events.MenuEvent;
      import mx.collections.*;

      [Bindable]
      public var menuBarCollection:XMLListCollection;

      private var menubarXML:XMLList =
      <>
      <menuitem label="APP_PROGRAM" >
      <menuitem label="APP_DRAG" />
      <menuitem label="APP_EXIT" />
      </menuitem>
      </>;

      private function initCollections():void {
      menuBarCollection = new XMLListCollection(menubarXML);
      }

      private function menuHandler(event:MenuEvent):void {

      }
      ]]>
      </mx:Script>
      <mx:MenuBar left="5" right="5" height="28" bottom="5" labelField="@Resource(bundle='myResources', key='@label')" itemClick="menuHandler(event);"
      dataProvider="{menuBarCollection}, @Resource" showRoot="true" fontSize="14"/>
      <mx:HBox left="5" top="5" right="5" verticalAlign="middle" horizontalAlign="left" paddingLeft="2" paddingRight="2" height="25">
      <mx:Button/>
      <mx:Button/>
      <mx:Spacer width="100%"/>
      <mx:Label text="@Resource(bundle='myResources', key='APP_TITLE')" fontSize="12" fontWeight="bold"/>
      <mx:Spacer width="100%"/>
      <mx:Button width="24"/>
      <mx:TextInput height="22"/>
      </mx:HBox>

      </mx:Canvas>


      And I have been created that file myResource.properties:
      quote:

      APP_TITLE=Flex Glade Application - English
      APP_PROGRAM=Program
      APP_DRAG=Drag this
      APP_EXIT=Exit


      I have been worked this complice with -locale en_US -source-path=../locale/locale)

      But i do not know that Menu-Root has problem? Please answer, if you know that Problem.

      Thanks bye SnakeMedia