|
@@ -0,0 +1,23 @@
|
|
|
|
+$(function(){
|
|
|
|
+
|
|
|
|
+ function loadProperties() {
|
|
|
|
+ jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
|
|
|
|
+ name : 'strings', //资源文件名称
|
|
|
|
+ path : '/i18n/', //资源文件路径
|
|
|
|
+ mode : 'map', //用Map的方式使用资源文件中的值
|
|
|
|
+ language : 'zh-CH',
|
|
|
|
+ callback : function() {//加载成功后设置显示内容
|
|
|
|
+ $('.i18n-text').each(function() {
|
|
|
|
+ console.log($(this).text())
|
|
|
|
+
|
|
|
|
+ $(this).text($.i18n.prop($(this).text()));
|
|
|
|
+ });
|
|
|
|
+ $('.i18n-input').each(function() {
|
|
|
|
+ $(this).value($.i18n.prop($(this).text()));
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ loadProperties();
|
|
|
|
+})
|