开发者

Abour ResourceBundle in AS3

开发者 https://www.devze.com 2023-04-12 19:25 出处:网络
I creadet a class that has more ResourceBundles in it. My app is multilanguage so I will need many \".properties\" files.

I creadet a class that has more ResourceBundles in it. My app is multilanguage so I will need many ".properties" files.

here is a sample code

开发者_运维知识库[ResourceBundle("LocalizedStrings_en_US")]
[ResourceBundle("LocalizedStrings_fr_FR")]
...
public class LocaleLoader
{
...
}

My question is if I add many ResourceBunlde lines in this class, will the file size of the main swf increase drastically or not?

Should use separata class files to load separate ResourceBundles for each language?


The [ResourceBundle] annotation itself won't have any effect on the file size. It's the -locale compile option of the mxmlc that matters.

-locale=en_US means to embed only the US-locale in the SWF

-locale=en_US, ja_JP means to embed both the US-locale and the Japan-locale

If you don't embed the Japan-locale you can load it at runtime with resourceManager.loadResourceModule(...).

To address completely the topic of Flex Localization Support please refer to the Slides & Samples in the Flex Localization Support article I wrote in the Obecto Training Portal.

0

精彩评论

暂无评论...
验证码 换一张
取 消