NSLocationAlwaysUsageDescription / NSLocationWhenInUseUsageDescription: where to place translations

My application supports 3 different languages: EN, DE, FR Since NSLocationAlwaysUsageDescription

/ is NSLocationWhenInUseUsageDescription

defined in Info.plist

, I'm wondering where I put the values ​​for DE and FR. Any ideas?

+3


source to share


1 answer


To translate Info.plist

into 3 languages, you need to create a file InfoPlist.strings

in each of the following directories:

  • en.lproj

  • fr.lproj

  • de.lproj

These 3 files should have the following content:

NSLocationWhenInUseUsageDescription = "YOUR TEXT HERE";
NSLocationAlwaysUsageDescription = "YOUR TEXT HERE";

      



Since the files will not appear automatically in the Xcode Project Navigator, you need to manually add them to the project package, this can be done by right-clicking the project name in Xcode and selecting the option Add files to X

, then selecting the files you just created.


Also, if you want to test the result and make sure everything works, changing Application Language

to is Edit Scheme > Run > Options

not enough.

You need to change simulator or device language with Settings > General > Language & Region > iPhone Language

+11


source







All Articles