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

后端 未结 12 1832
难免孤独
难免孤独 2020-11-22 17:13

As you might know the iOS 8 requires NSLocationWhenInUseUsageDescription key for using user\'s location. I have added this key and some gen

12条回答
  •  孤城傲影
    2020-11-22 17:45

    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!

    EDIT:

    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

    EDIT:

    Here is the official documentation for Info.plist keys localization.

    Credits to Marco, thanks for including the pics in this answer!

提交回复
热议问题