使用Cordova/Phonegap,如何最简单地翻译iOS虚拟键盘上的“Done”按钮?
例如,我的iPhone配置为使用法语。然而,该按钮仍显示“Done”按钮,而不是经典的适应法语的单词:“Ok”。
例如,我的iPhone配置为使用法语。然而,该按钮仍显示“Done”按钮,而不是经典的适应法语的单词:“Ok”。
我曾经在我的 Cordova 应用程序中遇到了同样的问题。我使用一个插件来编写 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>
在信息选项卡中设置此属性即可:
设置 CFBundleAllowMixedLocalizations
.plist 键也可以通过您的 config.xml
进行。只需在 iOS 平台配置中添加以下内容:
<platform name="ios">
<config-file parent="CFBundleAllowMixedLocalizations" platform="ios" target="*-Info.plist">
<true />
</config-file>
</platform>