0

I have a file input in my Phonegap app. On iOS, the file input opens a dialog from the OS itself with the question what action you want to take: Take photo, Photo library, Dropbox or More.

Is it possible to set the language of that dialog somehow? The strange thing is that the last option "More" does get translated into the language of the device, but the others don't.

I have tried setting the "defaultlocale" in config.xml, but this doesn't seem to fix the issue.

Kris
  • 824
  • 2
  • 12
  • 28
  • How are you generating the dialog. Are you using a plugin? Could you add some code? – L Balsdon Apr 21 '17 at 07:33
  • No plugins, it's just a standard html file input element. When you click the input, it automatically opens the iOS file selection dialog with the options mentioned above. – Kris Apr 21 '17 at 10:12
  • I think I have an answer for this but haven't got time to write it out. I will post it in a few hours. – L Balsdon Apr 21 '17 at 11:20

2 Answers2

0

This answer is for Cordova as the question was tagged as Cordova and didn't mention anything about Phonegap Build. This answer will not work on Phonegap build, only on local development with Phonegap/Cordova CLIs.

You can use a plugin like cordova-plugin-settings-hook to write in the info.plist

After installing it, add this to your config.xml (don't add the ios platform part, it should be there already, I put it on the example so you can see where to put it)

<platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="CFBundleLocalizations">
        <array>
            <string>es</string>
            <string>en</string>
            <string>fr</string>
            <string>...</string>
        </array>
    </config-file>
</platform>
jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
  • This put me in the right direction (thanks!) to find the answer I posted. Your answer might work, but what I found seems to work without an extra plugin. – Kris Apr 24 '17 at 09:54
  • @Kris you answer is for Phonegap Build, which you didn't mention on your question. My answer is for local development with Cordova or Phonegap CLIs. In fact, my answer will not work on Phonegap Build because the plugin uses a hook and hooks are not available in Phonegap Build. So edit your question and your answer to specify that it's for Phonegap Build – jcesarmobile Apr 24 '17 at 11:05
0

I fixed it by adding this to my config.xml file:

<config-file platform="ios" parent="CFBundleLocalizations" mode="replace">
    <array>
        <string>nl</string>
    </array>
</config-file>
Kris
  • 824
  • 2
  • 12
  • 28