js使用i18n获取的资源无法显示

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>个人测试</title>

</head>

<body onload="load()">
<div id="content" > 
     <div> 
         <label id="label_username"></label> 
         <input type="text" id="button-login"></input> 
     </div> 
     <div> 
         <label id="label_password"></label> 
         <input type="password" id="label-username"></input> 
     </div> 
     <input type="button" id="label-password"/> 
 </div>

</body>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.i18n.properties-min-1.0.9.js"></script>
<script type="text/javascript">
  function load(){  $(function(){
        jQuery.i18n.properties({
            name : 'strings', //资源文件名称

            path : '/i18n/', //资源文件路径

            mode : 'map', //用Map的方式使用资源文件中的值

            language:'en',

            callback : function() {//加载成功后设置显示内容

            alert($.i18n.prop('like'));

                $('#button-login').value=$.i18n.prop('home');

                $('#label-username').html($.i18n.prop('like'));

            }
        });
    });}
</script>
</html>

代码是网上找的,但是无法显示资源文件里的键值。alert一下,显示[like],文件里的是Like。那位大神解答一下。还有获取中文的时候乱码。

我们在工作中一般把编码设置为UTF-8,关于数据获取不到,你可以看看路径有没有问题

资源文件编码存储为utf-8编码,而且检查下服务器配置是否有语言配置文件后缀的mime隐射,如.properties文件的mime映射,没有会404找不到文件,当然无法加载配置信息