How to use iOS device settings for language in Ionic 5 / Cordova

How do set language for context menus (select all, cut, copy, paste…), file upload, camera dialogues and other iOS or plugin functionality that is outside of your core project?

The answer is CFBundleDevelopmentRegion set in info.plist

It seems CFBundleDevelopmentRegion is always set to en_US by default (or maybe this is because I build on a laptop that has these settings) thus showing context menus, file upload dialog etc in English.

I found that setting CFBundleDevelopmentRegion to empty uses device settings for language.

It seems making the change directly in Xcode does not work for some reason.

Put this in your config.xml ios section.

<platform name="ios">
   <config-file parent="CFBundleDevelopmentRegion" target="*-Info.plist">
        <array>
            <string />
        </array>
    </config-file>
</platform>

Note that some plugins seem to set language, so if you cannot get this to work, check your plugins. This was tested in Ionic 5 / Angular / Cordova.

Thanks to Maximillion Bartango on SO for putting me on the right track.

Please comment if this worked for you or if you have problems or other solutions.

Xcode and Bitbucket gives Authentication Failed

When cloning a Bitbucket repository from Xcode (using current version 9.2) I get Authentication failed.

Solution is to insert Password into URL.

Steps:

  1. Copy repository URL from Bitbucket – Overview, select HTTPS (not SSH)
  2. Paste it in to Xcode Clone window for Adding GitHub account (for example click “Clone an existing Project” from Xcode start screen)
  3. Before clicking the Clone button, edit the url to insert your Bitbucket password.
    Url looks something like this:
    https://[email protected]/xxx/yourproject.git
    Add password like this, colon and your password:
    https://username:password@bitbucket.org/xxx/yourproject.git
  4. Click Clone button and it should work