【问题标题】:Translating "Done" button on iOS keyboard to other language将 iOS 键盘上的“完成”按钮翻译成其他语言
【发布时间】:2014-09-21 00:08:42
【问题描述】:

使用 Cordova/Phonegap,翻译 iOS 虚拟键盘上的“完成”按钮最简单的方法是什么?

例如,我的 iPhone 被配置为使用法语。
但是,按钮仍然显示“完成”按钮,而不是经典的法语改编词:“Ok”。

【问题讨论】:

  • 有同样的问题:o

标签: ios cordova translation


【解决方案1】:

我的科尔多瓦应用程序也面临同样的问题。我用一个写在 Info.plist 中的插件修复了它

<plugin id="com.example.plugin" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
    <name>Example</name>
    <description>A label translate example</description>    
    <platform name="ios">
        <config-file target="*-Info.plist">
            <key>CFBundleAllowMixedLocalizations</key>
            <array>
                <string>Yes</string>
            </array>
            <key>CFBundleLocalizations</key>
            <array>
                <string>fr</string>
            </array>
            <key>CFBundleDevelopmentRegion</key>
            <array>
                <string>fr_FR</string>
            </array>
        </config-file>  
    </platform>
</plugin>

【讨论】:

  • 出于某种原因,我需要在config-file 中使用parent= 设置密钥,但后来它起作用了。 Example is here
  • 它在 iphone 7 中不适合我。你有什么想法吗?
  • 但是你把实际的字符串放在哪里呢?
【解决方案2】:

Info 选项卡中设置此属性就足够了:

【讨论】:

  • 我在这个列表中没有我的地区,怎么办?
  • 进行此更改后,键盘将始终显示单一语言..它不适用于 i18n。
【解决方案3】:

也可以通过您的config.xml 设置CFBundleAllowMixedLocalizations .plist 密钥。只需将其添加到您的 iOS 平台配置中:

<platform name="ios">
  <config-file parent="CFBundleAllowMixedLocalizations" platform="ios" target="*-Info.plist">
    <true />
  </config-file>
</platform>

【讨论】:

  • 它在我的项目上运行。 “完成”按钮在法语中翻译为“确定”。您是否检查过您的 Info.plist 文件在 Xcode 中是否已更改?有你的检查 iOS 设备语言?显示语言由设备操作系统决定。
  • 不,它没有工作。
  • 我必须明确添加属性“本地化资源可以混合”:是的,从 Xcode 信息选项卡中,然后它适用于所有语言。
  • 今天早上经过测试和重新测试:它正在工作。我的配置:@ionic/cli-utils:1.19.1 ionic(Ionic CLI):3.19.1 cordova(Cordova CLI):8.0.0 Cordova 平台:ios 4.5.4 ionic-plugin-keyboard 2.2.1 你做错了什么与您的项目。删除您的 iOS 平台并重新添加。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-29
  • 1970-01-01
相关资源
最近更新 更多