Translating “Done” button on iOS keyboard to other language

和自甴很熟 提交于 2019-12-07 03:09:37

问题


Using Cordova/Phonegap, what is the easiest way to translate the "Done" button present on the iOS virtual keyboard?

For instance, my iPhone is configured as using French language.
However, the button still shows "Done" button and not the classic French adapted word: "Ok".


回答1:


I was facing the same problem with my cordova app. I fixed it with a plugin that writes in the 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>



回答2:


Setting this property in Info tab was enough:




回答3:


Setting CFBundleAllowMixedLocalizations .plist key is also possible via your config.xml. Just add this in your iOS platform configuration:

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


来源:https://stackoverflow.com/questions/25954478/translating-done-button-on-ios-keyboard-to-other-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!