[ios] How to localise a string inside the iOS info.plist file?

In addition to the accepted answer (the project is on Flutter but it's basically the same as native):

I do have folders Base.lproj, en.lproj, xx.kproj. etc. with InfoPlist.strings in each. This file has lines like this (no quotes around the key and with a semicolon at the end):

NSLocationWhenInUseUsageDescription = "My explanation why I need this";

Check that you have your languages in your YourProject > Info: enter image description here

Also, check the project.pbxproj file, it is in XXX.xcodeproj/project.pbxproj: it should have all your languages in codes (en, fr, etc.)

enter image description here

But even then it didn't work. Finally, I noticed the CFBundleLocalizations key in the Info.plist file. (to open it as raw key-values in XCode - right mouse button on the Info.plist file -> Open As -> Source Code) Make sure that the values in array are codes rather than complete words, for example fr instead of French etc.

<key>CFBundleLocalizations</key>
<array>
    <string>en</string>
    <string>ru</string>
    <string>lv</string>
</array>

And double-check that your device is set to the language you're testing. Cheers

P.S. "Development Language" doesn't affect your issue, don't bother changing it.

Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to plist

NSCameraUsageDescription in iOS 10.0 runtime crash? iOS 10 - Changes in asking permissions of Camera, microphone and Photo Library causing application to crash How to localise a string inside the iOS info.plist file?

Examples related to beta

Swift 3 - Comparing Date objects How to localise a string inside the iOS info.plist file? Android Studio Gradle project "Unable to start the daemon process /initialization of VM"