6

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".

Mik378
  • 21,881
  • 15
  • 82
  • 180

3 Answers3

4

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>
creal
  • 104
  • 8
3

Setting this property in Info tab was enough:

enter image description here

Mik378
  • 21,881
  • 15
  • 82
  • 180
2

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>
MrP
  • 1,408
  • 18
  • 23
  • It's working on my projet. The "Done" button is translate to "OK" in French. Have you check that your Info.plist file has changed in Xcode ? Have your check iOS device language ? It is the device OS that decide of the language to display. – MrP Feb 22 '18 at 17:49
  • Nope it did not wokred. – Prasobh.Kollattu Feb 22 '18 at 18:05
  • 1
    I had to explicitly add property 'Localized resources can be mixed' : YES, from Xcode Info tab, then it worked for all languages. – Prasobh.Kollattu Feb 22 '18 at 18:06
  • Tested and re-tested this morning: it's working. My config : @ionic/cli-utils : 1.19.1 ionic (Ionic CLI) : 3.19.1 cordova (Cordova CLI) : 8.0.0 Cordova Platforms : ios 4.5.4 ionic-plugin-keyboard 2.2.1 You did something wrong with your project. Delete your iOS platform and re-add it. – MrP Feb 23 '18 at 07:53