【问题标题】:Internationalizing an mx:MenuBar?国际化 mx:MenuBar?
【发布时间】:2011-12-27 00:38:22
【问题描述】:

嗯,通过必须对 Flex SDK 进行逆向工程并进行大量挖掘( specific question 对我帮助很大!(与some updates for flex 4.5)。

问题是,我不能在<fx:XMLList> 中使用我的{getLand('key')} 绑定(如何定义<mx:MenuBar> 的内容。我在下面包含了一些示例i18n,以及菜单栏。

<!-- Example of proper (working) i18n -->
<s:TextArea text="{getLang('Rules')}"/>

<!-- Problem Area (a bare bones example) -->
<!-- Error message in IDE: Access of undefined property _application_XMLList1 -->
<mx:MenuBar labelField="@label">
    <fx:XMLList>
        <menuitem label="{getLang('File')}"/>
    </fx:XMLList>
</mx:MenuBar>

【问题讨论】:

    标签: apache-flex internationalization flash-builder flex4.5


    【解决方案1】:

    尝试将 XMLList 放在菜单栏之外,如下所示:

    <fx:Declarations>
      <fx:XMLList id="_menuStuff">
        <menuitem label="{getLang('File')}"/>
      </fx:XMLList>
    </fx:Declarations>
    
    <mx:MenuBar labelField="@label" dataProvider="{_menuStuff}"/>
    

    应该可以,祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-15
      • 2015-08-31
      • 2021-12-10
      • 2019-10-08
      • 2019-02-09
      • 2011-10-27
      • 2012-02-22
      相关资源
      最近更新 更多