Android locales/en US/translation.json在Eclipse中加载,但在iphone中失败
我目前正在使用phonegap 2.5开发一个跨平台的移动应用程序。当应用程序启动时,它会加载一个json文件来设置应用程序的语言。它在android中工作得非常好,但在ios中它会告诉我一个错误:加载失败:locales/el-GR/translation.json。我试图更改locales文件夹的相对路径或将当前文件夹移动到其他作用域,但两种方法都不起作用 WWW子文件夹路径Android locales/en US/translation.json在Eclipse中加载,但在iphone中失败,android,ios,json,cordova,Android,Ios,Json,Cordova,我目前正在使用phonegap 2.5开发一个跨平台的移动应用程序。当应用程序启动时,它会加载一个json文件来设置应用程序的语言。它在android中工作得非常好,但在ios中它会告诉我一个错误:加载失败:locales/el-GR/translation.json。我试图更改locales文件夹的相对路径或将当前文件夹移动到其他作用域,但两种方法都不起作用 WWW子文件夹路径 _www/ __index.html __js/ ___some js files like as main.js,
_www/
__index.html
__js/
___some js files like as main.js, cordova.js,jqmobi.min.js, i18next-1.7.1.min.js e.t.c.
__locales/
___en-US/
____translation.json
以及我在main.js中调用的函数:
i18n.init(
{
lng: AppSettings.Language.get(),
fallbackLng: 'en-US',
/* Where __lng__/__ns__.json = en-US/translation.json */
resGetPath : '/locales/__lng__/__ns__.json',
resPostPath: '/locales/__lng__/__ns__.json',
debug: true
},
function(){
}
);
在main.js中,我给出了加载translation.json的相对url路径(locales/en-US/translation.json)。这在安卓系统中运行良好,但在ios系统中似乎无法加载。
所以,如果你能,我需要一些帮助