【Stimulsoft Reports Flex教程】为Viewer和Designer设置本地化

下载Stimulsoft Reports Flex最新版本

此示例显示如何更改查看器和设计器的当前本地化。要设置本地化,您需要创建 StiLanguage对象。您可以使用静态帮助程序从文件加载语言 - 使用StiLanguage.fromUrl()方法。作为参数,此方法接收在组合框中选择的语言XML文件的路径。最后,您应该通过调用StiLocalization.setLanguage()方法来设置当前语言:

private function onSetLocalization(): void
{
    // Create Language object
    var language: StiLanguage = StiLanguage.fromUrl("localization/" + comboLocalizations.text);
    // Set Localization
    StiLocalization.setLanguage(language);
}
<mx:ComboBox
    id="comboLocalizations" x="30" y="30" width="100" rowCount="10" openDuration="150" closeDuration="150" 
    dataProvider="['be.xml', 'cro.xml', 'cz.xml', 'de.xml', 'en.xml', 'es.xml', 'fa.xml', 'fr.xml', 'hu.xml', 'it.xml',
    'ka.xml', 'lt.xml', 'nl.xml', 'pl.xml', 'pt-BR.xml', 'ro.xml', 'ru.xml', 'se.xml', 'ser.xml', 'sk.xml',
    'ua.xml', 'zh-CHS.xml', 'zh-CHT.xml']" />
<mx:Button id="buttonSetLanguage" x="140" y="30" width="120" label="Set Language" click="onSetLocalization()" />

下面的屏幕截图中,您可以看到示例代码的结果。

Stimulsoft

下载示例

猜你喜欢

转载自blog.csdn.net/xiaochuachua/article/details/85336195