【问题标题】:Using internationalization with phonegap通过 phonegap 使用国际化
【发布时间】:2014-05-25 22:17:29
【问题描述】:

我正在使用 jquery.18n,但在 phonegap 构建后,并在我的设备上安装应用程序后,翻译不起作用...

用谷歌浏览器测试正常,问题是传到phonegap后。

AndroidManifest 或 Config.xml 中是否需要进行任何更改?

我的代码使用示例:

$(document).ready(function(){ 
   jQuery.i18n.properties({
        name:'Messages', 
        path:'language/', 
        mode:'both',  
        language: 'pt-BR', 
        callback: function() {
            $("#user").attr('placeholder',Placeholder_User);
            $("#pass").attr('placeholder',Placeholder_Pass);
            $("#btn-acess").html(Button_Login);
            $("#txt-or").html(Txt_Or);
            $("#btn-register").html(Button_Register);
        }
    });   
});

就像上面说的代码只能在手机桌面浏览器上工作。

谢谢

【问题讨论】:

    标签: android jquery html cordova internationalization


    【解决方案1】:

    您好,您可以尝试通过在 android 中设置语言环境来指定语言。您可以在 android 中使用以下代码。
    Locale locale2 = new Locale("give_ur_locale_here"); Locale.setDefault(locale2);
    然后使用吹线来加载你的 html 文件
    super.loadUrl(Config.getStartUrl(),2100);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-07
      • 2011-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-08
      • 1970-01-01
      相关资源
      最近更新 更多