惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
D
Docker
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
L
LangChain Blog
H
Help Net Security
B
Blog
T
Tailwind CSS Blog
V
V2EX
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
美团技术团队
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
I
InfoQ
Project Zero
Project Zero
I
Intezer
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AWS News Blog
AWS News Blog
Spread Privacy
Spread Privacy
S
Securelist
Recorded Future
Recorded Future
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 叶小钗
S
Security Affairs
Blog — PlanetScale
Blog — PlanetScale
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
The Hacker News
The Hacker News

博客园 - 昊子

工作流参考模型(Workflow Reference Model) DNN default document的异常错误 如何使用GoogleCode提供的SVN Source Control服务 Norton PartitionMagic 8.0 Resizing Boot Partition 智能提示和那些值得崇拜的人 推荐一个Flex & AIR皮肤站点 SessionDiskCache 0.1版发布 Flex Repeater 多层嵌套 从没走远 SubmitMask 1.0 发布 如何获取Footer中的子控件 DNN学习笔记 之一 配置 使用NHibernate时产生的一个错误 NHibernate官方文档 之 NHibernate指南-前言 C#反转单向链表 C#事件编程 静态构造函数和静态成员变量初始化的调用时间 NHibernate和SqlImage 结束无谓的讨论吧
Flex locale
昊子 · 2007-07-08 · via 博客园 - 昊子

ResourceBundle的使用

新建文件夾(Locale)保存Locale資源
建子文件夾(en_US, cht_HK)用於區分Locale
在eu_US, cht_HK中分別添加資源配置文件 (資源名稱.properties)

項目屬性中設置Source Path,Add Folder    "Locale/{locale}", 其中{locale}將被編譯參數 -locale 自動替換

需要用locale的as 或 mxml中增加引用對象
[ResourceBundle("資源名稱")]
private static var rb:ResourceBundle;

<<--code AlertTest.mxml >>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
 <mx:Script>
  <![CDATA[
  import mx.resources.ResourceBundle;
       import mx.controls.Alert;
       
       
  [ResourceBundle("AlertMessage")]
       private static var rb:ResourceBundle;
       
       private function alertMessage():void
       {
        Alert.show(rb.getString('AlertMessage'));
       }
  ]]>
 </mx:Script>
 <mx:Button label="@Resource(key='AlertButtonName', bundle='AlertMessage')" click="alertMessage()"/>
</mx:Application>

<< - code  locale/en_US/AlertMessage >>

AlertMessage=The alert message in English
AlertButtonName=click me

<< - code  locale/cht_HK/AlertMessage.properties 注意,中文應使用UTF-8編碼
file-properties-info-Text file encoding >>

AlertMessage=繁體中文提示信息
AlertButtonName=點我


然後在編譯時設置Locale   右點項目-屬性-Complier-Additional Complier Arguments "-locale cht_HK"