esskar
esskar

Reputation: 10940

NSLocationAlwaysUsageDescription/NSLocationWhenInUseUsageDescription: where to put translations

My app supports 3 different languages: EN, DE, FR As NSLocationAlwaysUsageDescription / NSLocationWhenInUseUsageDescription are defined in Info.plist, I am wondering where I put the values for DE and FR. Any ideas?

Upvotes: 3

Views: 3465

Answers (1)

Zack Braksa
Zack Braksa

Reputation: 1666

In order to translate Info.plist to the 3 languages, you would need to create a InfoPlist.strings file in each of the following directories :

  • en.lproj
  • fr.lproj
  • de.lproj

The 3 files should have the following content :

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

Since the files won't show up automatically in Xcode's Project Navigator, you have to manually add them to the project bundle, this can be achieved via right-clicking the project name in Xcode and choosing the Add files to X option, then selecting the files you just created.


Also if you want to test the result & make sure things work, changing the Application Language in Edit Scheme > Run > Options isn't enough.

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

Upvotes: 12

Related Questions