Soheil B.Marvasti Soheil B.Marvasti - 4 months ago 48
iOS Question

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

As you might know the iOS 8 requires NSLocationWhenInUseUsageDescription key for using user's location. I have added this key and some general information into my info plist.
enter image description here

How can I use translation string inside the plist file ?

-- Update --

I already have a Localizable string. I'm just wondering that can I use something like
NSLocalizedString(MYSTRING,nil) inside the plist string. I know that I can create multiple file of info.plist for localisation but I was wondering there might be an easier way.


You should use InfoPlist.strings file to localize values of Info.plist. To do this, go to File->New->File, choose Strings File under Resource tab of iOS, name it InfoPlist, and create. Open and insert the Info.plist values you want to localize like:

"NSLocationWhenInUseUsageDescription" = "Description of this";

Now you can localize InfoPlist.strings file with translations. Good Luck!


select the localization options, or enable localization if needed,

right side editor

you should be able to see the file also on the left side editor.

left side editor