我正在使用 jquery i18n 插件(http://code.google.com/p/jquery-i18n-properties/)来国际化放置在 jquery/js 中的消息。我有以下项目结构。
我在文件夹中有some.js
文件,在文件内部我必须引用位于文件夹文件夹中的属性文件。我可以这样做吗?在我放置的文件夹的内部文件夹和. 在两个属性文件中,我都放置了属性。现在我正在尝试按如下方式访问它。但是下面的代码没有得到键的值。. 我是否错误地引用了属性文件?我的属性文件引用正确吗?请帮我。js
some.js
properties
src/main/resources
properties
src/main/resources
Messages.properties
Messages_en_US.properties
myForm.success.msg=Success
myForm.success.msg
instead of giving value, it is giving the key itself but not the value
JSP代码:
<script type="text/javascript" src="./public/js/some.js"></script>
<script type="text/javascript" src="./public/js/jquery.i18n.properties-min-1.0.9.js"></script>
一些.js
jQuery.i18n.properties({
name:'Messages',
path:'properties/', //as i have properties file in properties folder of src/main/resources
mode:'both',
callback: function() {
alert("message "+jQuery.i18n.prop('myForm.success.msg'));
}
});