1.3.4.3. Javascript调用

此外,框架还提供了两种前端Javascript国际化调用支持,第一种是系统默认将把“.js”结尾的资源key生成到前端国际化资源中,通过$.i18n函数获取,同时支持动态

参数,如下例:

alert($.i18n('my.resource.js'));
alert($.i18n('my.resource.js','参数1','参数2'));

第二种是在i18n文件夹根下配置export_to_js.xml文件,用于指定哪些后台国际化资源要开放给前端Javascript引用,该文件内容例子如下:

<?xml version="1.0" encoding="utf-8"?>
<export>
    <resKey>common.button.cancel.label</resKey>
    <resKey>common.button.close.label</resKey>
    <resKey>common.button.ok.label</resKey>
</export>