How to Localize the Plist file?

Sachin Khard
2 min readSep 17, 2019

--

Localization is the process of supporting multiple languages in your application. In many cases, you make your app with English user interface first and then localize the app to other languages such as Arabic. Today I am going to show how to localize the permission text used in plist file.

Please follow the below steps to localize the Plist file:

Step 1: Add the language in you your project.

Select project -> Select localisations ->Add language

Step 2: Add a new string file and name it “InfoPlist.strings”.

Step 3: Select “InfoPlist.strings” and on the right side click on ” localize ” this and select the respective language whatever present in your project.

Step 4: Then it will create the file for the base, English, and respective language.

Step 5: Now localize the Plist key description.

for the English file:

NSCameraUsageDescription” = “Uses the camera for taking profile picture and image detection”;

NSLocationAlwaysAndWhenInUseUsageDescription” = “Uses location for getting user current address”;

NSLocationAlwaysUsageDescription” = “Uses location for getting user current address”;

NSLocationUsageDescription” = “Uses location for getting user current address”;

NSLocationWhenInUseUsageDescription” = “Uses location for getting user current address”;

NSPhotoLibraryUsageDescription” = “Uses photo for taking profile picture and image detection”;

for Arabic file:

NSCameraUsageDescription” = “يستخدم الكاميرا لالتقاط صورة الملف الشخصي واكتشاف الصورة”;

NSLocationAlwaysAndWhenInUseUsageDescription” = “يستخدم الموقع للحصول على عنوان المستخدم الحالي”;

NSLocationAlwaysUsageDescription” = “يستخدم الموقع للحصول على عنوان المستخدم الحالي”;

NSLocationUsageDescription” = “يستخدم الموقع للحصول على عنوان المستخدم الحالي”;

NSLocationWhenInUseUsageDescription” = “يستخدم الموقع للحصول على عنوان المستخدم الحالي”;

NSPhotoLibraryUsageDescription” = “يستخدم الصورة لالتقاط صورة الملف الشخصي واكتشاف الصورة”;

We have mentioned few common keys which we are used in most of the projects. You can take any key from the Plist file and localize it.

Step 6: Now your Plist file is localized.

Step 7: It depends on your iPhone or iPad ‘s language, it will automatically pick the description from the “InfoPlist.strings”. file.

--

--

Sachin Khard
Sachin Khard

Written by Sachin Khard

Independent iOS developer, author, trainer

No responses yet