您的位置:首页 > Web前端 > JQuery

jQuery.i18n.properties实现前端国际化

2015-11-18 10:01 405 查看
jQuery.i18n.properties的下载地址:
jquery.i18n.properties-1.0.9.js:下载地址:http://download.csdn.net/detail/snails_zx/9224023
jquery.i18n.properties-min-1.0.9.js:下载地址:http://download.csdn.net/detail/snails_zx/9224023

新建2个文件
strings.properties
strings_zh.properties

内容分别为
strings.properties

user=user name
pwd = password


strings_zh.properties

user=用户名
pwd = 密码


关键代码

jQuery.i18n.properties({
name : 'strings', //资源文件名称
path : '/i18n/', //资源文件路径
mode : 'map', //用Map的方式使用资源文件中的值
language : 'zh',
callback : function() {//加载成功后设置显示内容
alert($.i18n.prop('user'));
alert($.i18n.prop('pwd'));
}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: