In this simple step by step guide i will go through a simple project and show you how to localize your iOS application name and other files according to your language or region.
My work station is Mac OS X 10.12 and macOS sierra. My current Xcode version is 8.0
First we will start a project
Add a label in the Main.storyboard and set text as “This is Title in English”
Run the app and you will get a screen like below.
To add localization to your project, Select your project from top left corner and goto ‘info’ tab
and add localization language (for now add french for this example)
You will be prompted to generate localization files. (see below)
Resource File : check/uncheck if you want to create localizable file.
Reference Language : Default language.
File Types : You can create either more than one storyboards or localizable strings. (I just created string files only here)
Press finish button. and you’re done..! You will be generated localization files for your storyboards and string files.
You can see the changes visually. Main.storyboard file is for base language and
Now go and change the storyboard label text in the Main.strings file which is created for french localization, like below.
Before you run the app, go and change the language and region setting in Simulator to french.
Now you run the app.!! You will get the following result.
We have not finished yet. We want to change the Application name according to the user’s location, that is displayed under the appicon. Todo that, We need to create infoPlist.string file. (Its already created in the previous step.)
Add the Keys of the info.plist file and localizable values like below.
"CFBundleDisplayName" = "Bonjour"; "CFBundleName" = "Bonjour..";
done.! You can see the name has changed once you setup your iphone7 simulator to french language and region.
Check the App icon Name has changed now.
Please write in the comment section if you feel this guide is helpful for you. Don’t forget to give me your feedback. we will continuously update the article.