zoukankan      html  css  js  c++  java
  • 转 flex中ResourceBundle的用法

    Flex的ResourceBundle用处主要是在runtime的时候加载一些文件,最大用处就是用做国际化。 

    1、在flex中的project的property面板里选择flex compiler选项,在compiler arguments里添加参数: 
    -locale en_US -source-path=../resourcebundles/{locale} -services=../services/services-config.xml
    其中的{locale}就是en_US,而且en_us其实就是一个目录

    2、创建配置文件(*.properties),里面都是键值对,比如name=123,old=123 ... 
    ----------------------------------------------------------------------------------------
    welcome.title=DigiPri Widgets
    statusMessage.switchView=Click on either icon to switch to the respective view
    statusMessage.maximizeReport=Click to maximize report
    statusMessage.removeReport=Click to remove report
    statusMessage.moveReport=Click and drag to rearrange the reports
    statusMessage.backTrack=Click to return to the previous report

    labels.week=Week

    xmlFiles.services=xml/services.xml
    ----------------------------------------------------------------------------------------

    3、在flex程序中,绑定它。比如 
    <fx:Metadata>
    [ResourceBundle("crm")]
    </fx:Metadata>

    然后就可以用了。比如
    resourceManager.getString('crm','statusMessage.backTrack') 

    在ArcGIS Server For Flex API的index.mxml中就引用了

        <fx:Metadata>
    [ResourceBundle("ViewerStrings")]
        </fx:Metadata>

    用来设置不同的国家的语言

    参考:

    java.util.ResourceBundle使用详解 
    http://lavasoft.blog.51cto.com/62575/184605/
  • 相关阅读:
    LDAP Authentication for openNebula3.2
    opennebula auth module ldap
    opennebula extend(expending) auth module ldap
    centos6.4 ceph安装部署之ceph object storage
    centos6.4 ceph安装部署之cephFS
    ERROR: modinfo: could not find module rbd FATAL
    centos6.4 ceph安装部署之ceph block device
    Cannot retrieve metalink for repository: epel.
    卡特兰数
    iOS开发之UIImage等比缩放
  • 原文地址:https://www.cnblogs.com/x38160/p/3179272.html
Copyright © 2011-2022 走看看