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

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

博客园 - 昊子

工作流参考模型(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"