Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change cordova-camera-plugin language in iOS?

I wish to change the cordova-camera-plugin language. Apparently it is dependent on a variety of things. My development environment is Tools for Cordova in Visual Studio 2015. It is unlikely that it matters but I am using the Ionic framework in my app. We build our app for iOS on a MacBook Pro laptop running Xcode 7. The device I am testing on is an Ipad running iOS 9.1 with Dutch as first language and english as second.

In my app when you open the camera you have a few options such as Cancel, Use Photo and Retake Photo.

The things I have done to try and make the plugin localized to the Dutch language are the following.

In config.xml I have changed the following line to

<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" 
xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" 
id="hop.test1" 
version="1.0.1" 
xmlns="http://www.w3.org/ns/widgets" 
defaultlocale="nl-NL">

And in my /platforms/ios/projectname/projectname-Info.plist I have added the following lines:

<plist version="1.0">
  <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>nl</string>
    <key>CFBundleLocalizations</key>
    <array>
      <string>nl</string>
    </array>
  <!-- other values omitted !-->
  </dict>
</plist>

nl appears to be the correct localization notation for dutch based on my search results around google and stackoverflow.

The problem is that when I build my app and test the camera, the camera buttons are still written in english. Have I implemented something wrong, am I missing some values somewhere or is this the wrong way to go about localizing a plugin in cordova?

like image 444
Perfection Avatar asked Dec 15 '15 10:12

Perfection


1 Answers

Just make the settings in Xcode. They will not be overwritten after you make another cordova build:

enter image description here

UPDATE:

If you don't have the entry «Localization native development region», then:

– Go to info -> select your target

– Right click on an existing key entry and choose Add Row

– Type «Localization …», when Xcode autocompletes your input, then select under value your language.

like image 113
Joerg Avatar answered Sep 21 '22 12:09

Joerg