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

后端 未结 12 1829
难免孤独
难免孤独 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:47

    I would highly recommend reading Apple's guides, and viewing the WWDC resources listed here: Internationalization and Localization Topics

    To specifically answer your question, when you add a new language to your projectenter image description here, you get an opportunity to choose what InfoPlist files to include (if you have multiple targets, you'll have multiple Info plist files). All you need to do to get the following screen is hit the + under Localizations and choose a new language to add support for. enter image description here

    Once you've added, it will create the necessary string files in the appropriate lproj directories for the given language.

    --EDIT--

    Just to be clear, iOS will swap out the string for your Plist file based upon the user's currently selected language using the plist entry's key as the key in the localized strings file.

提交回复
热议问题