How to localize info.plist in Xcode

As you know with iOS 14 Apple requires consent to access the IDFA (Identifier for Advertisers), you need to display the App Tracking Transparency authorization request for accessing the IDFA. How to implement this change? Just update your Info.plist and add the NSUserTrackingUsageDescription key with a custom message describing your usage. My app supports more languages and the info.plist file is only one… 🤔

How to localize info.plist in Xcode ?

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

I read a lot of articles about automatically localize the info.plist file but i had several problems. The easiest solution was to:

  • Add in the project a new Strings file InfoPlist.strings (case sensitive), I’ve already written it but I want to repeat it otherwise it won’t work. You need to create the InfoPlist.strings file, not Infoplist.strings or infoPlist.strings.
  • Open the InfoPlist.strings file and add your keys and custom descriptions.
"NSUserTrackingUsageDescription" = "My app will use this identifier to provide you with personalized ads.";
  • Select the InfoPlist.strings and use the Localization section in the File Inspector to localize the file. Press the Localize… button to add additional Localizations to your app.
  • Run the simulator in each languages and this will work 👍

 

If you think your friends/network would find this useful, please share it with them. I’d really appreciate it.

Thanks for reading! 🌟

 

Reference: About Information Property List Files