tailieunhanh - Flex 3 with Java- P6

Tham khảo tài liệu 'flex 3 with java- p6', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 12 a SimpleLocalization 5 .settings 3 bin-debug 5 html-template I i. 3 libs i Ö- locale - ft en_U5 .Bl j ft fr_FR .Bl ties - ft zh_CN .Bl ties - src .actionScriptProperties i i L .flexProperties I X .project 5. Now create a new file under each subfolder and name it MyResource. properties. Once you create the properties file change its encoding by right-clicking on it selecting Properties and then changing Text file encoding to UTF-8 as shown in the following screenshot. Make sure that you follow this process for each resource file. 237 Internationalization and Localization O O 6. Now copy the following key value into each resource file Add greeting_text Hello into under the en_US folder. Add greeting_text Bonjour into under the fr_FR folder. Add greeting_text f into under the zhCN folder. O 7. Once you create your properties file we are ready to modify our application code. Open the file and modify it as shown in the following example xml version encoding utf-8 mx Application xmlns mx http 2006 mxml mx Metadata ResourceBundle MyResource mx Metadata mx Label text MyResource greeting_text fontSize 48 mx Application As you can see in the above code we have defined the mx Metadata tag that declares the resource bundle name we are using MyResource. Do not specify the .properties extension. Next we have changed the mx Label definition and we are now binding its text property with the bundleName key method s returned value. resourceManager is an instance of the ResourceManager class that is available explicitly to all components that extend the UIComponent Validator and Formatter classes. The resourceManager property lets you access a singleton instance of the ResourceManager class which loads resource bundles. It also .

TỪ KHÓA LIÊN QUAN