Does the telephone exchange change the label language?

I have a Phonegap application where I use a camera plugin. The problem is that the buttons do not use the native language of iOS, instead they are only English ("Retake" and "Use", etc.).

The application I am doing is an application for children, but they are not native English speakers. Therefore, I would like to have it in my native language.

Can these buttons be translated into the correct language?

+6
source share
6 answers

I managed to change the label languages ​​by changing the project layer ( platforms/ios/ProjectName/ProjectNAme-Info.plist ).

I changed CFBundleDevelopmentRegion from English to fr_FR and added this array:

 <key>CFBundleLocalizations</key> <array> <string>fr</string> </array> 
+2
source

If you use Xcode as an IDE to develop your project, you can localize it as a regular iOS project. To find out how to do this, you can check out this other post . You will not need to provide a translation for these “words” (“Repeat, use, etc.”). Just by setting the correct localizations, I will say that iOS uses its native language.

But if you use PhoneGap Build to compile your project, check out this section on the PhoneGap Build forum. Like the Xcode procedure, you will need to create a folder called "locales" in your / www directory and specify the languages ​​you want to use there. Again, you do not need to provide a translation for these buttons. IOS will do on its own.

+1
source

If you don’t want to manually change the language in Xcode after each build, you can make the following updates in the phonegap / cordova source code on your Mac:

(Example with corridor 3.6.3 and French, you need to update your version and language)

 Folder : ~\.cordova\lib\npm_cache\cordova-ios\3.6.3\package\bin\templates\project\__PROJECT_NAME__\ File : __PROJECT_NAME__-Info.plist Update : => Change <key>CFBundleDevelopmentRegion</key> <string>English</string> to <key>CFBundleDevelopmentRegion</key> <string>France</string> => Add after it <key>CFBundleLocalizations</key> <array> <string>fr</string> </array> Folder : ~\.cordova\lib\npm_cache\cordova-ios\3.6.3\package\bin\templates\project\__PROJECT_NAME__\Resources\ Update : => Create a 'fr.lproj' folder by Copy/Paste of the 'en.lproj' folder => Complete the translation in 'fr.lproj/Localizable.strings' file (not required) 

This will affect all projects that you create with this version of cordova.

Make a backup copy of your cordova folder before and do not leave unwanted files in the templates folder, otherwise they will be copied to the final package.

Hope this helps.

+1
source

Cordoba is fortunately open source .
The first step is to report the error in the Apache Cordova bug tracker . Then clone the source code of the cordova to understand why the plugin does not display the correct language.

It is not that difficult. Plugins are just the glue between the javascript function and the native function.

0
source

In fact, CFBundleDevelopentRegion seems to be a rollback if iOS cannot find the localizations declared in CFBundleLocalizations.

You do not need to change this key. Just adding an array of ISO country codes to the .plist (as Michael did) is enough.

0
source

The solution is to declare the languages ​​in your plist file as follows:

<key>CFBundleLocalizations</key> <array> <string>it</string> <string>es</string> </array>

If you do not want to do this manually because you probably are not tracking the plist file, you can use the Custom Config Configova plugin to add missing keys to your plist file when running cordova prepare

0
source

All Articles