iOS localization: Step-by-step Guide

The process of localization is sometimes tedious and unorganized. Lokalise helps you solve this problem. In this tutorial, we’ll focus on enabling localization in your application and adding, managing and integrating localizations in your project.

This tutorial is based on Xcode 8.2.1, which shows how to setup localization from zero to hero and use Lokalise as the translation management platform. If you are a seasoned localization master, we’d still recommend going through and take notes of some specific localization details.

Part I: Setting up your app

Step 1: Create Localizable.strings

Localizable.strings stores app strings as key-value pairs for each language. Let’s create this file for the base language first. Select File → New → File… or just tap ⌘-N. Search for strings and you will get Strings File in Resource window.

Choose this option and name the file Localizable.

Now, let’s select Localizable.strings in the Navigator. In Utilities, you will see localization panel.

Click Localize… and select English from the dropdown menu.

Step 2: Adding languages

Let’s add some languages and create .strings file for each of the languages.

Select your root project file, then the project panel. Down in localization section simply click + and add the languages you need. Select only Localizable.strings for localization. We will add German and Russian for demo purposes.

Let’s find Localizable.strings using Navigator. Now you can expand it and see a Localizable.strings for every language.

Step 3: Working with localizations

Now once Localizable.strings files are ready, let’s populate these. As mentioned earlier, the localization process involves keys and values. Key is usually an ID of the copy you want to put in place on elements. Let’s add two entries into each of the .strings files.

Localizable.strings (English)

"welcome_sceen_title" = "Welcome";
"login_button" = "Log in";

Localizable.strings (German)

"welcome_sceen_title" = "Willkommen";
"login_button" = "Einloggen";

Localizable.strings (Russian)

"welcome_sceen_title" = "Добро пожаловать";
"login_button" = "Вход";

Once the keys are set up, let’s learn how to get the translations for these. To do that we will use NSLocalizedString method. Modify application:didFinishLaunchingWithOptions: method of your delegate to test-drive the localization system.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    print(NSLocalizedString("welcome_sceen_title", comment: ""))
    return true

Hurray! You should get Welcome printed in the console.

Tip #1: the shortcut

Typing NSLocalizedString(“key”, comment: “comment”) all the time will annoy you and make your code look heavier and harder than it needs to be. To make your life easier, choose one of two options:

Option 1. Add String extension

extension String {
    var localized: String {
        return NSLocalizedString(self, comment: "")

Option 2: Add postfix operator

postfix operator ~
postfix func ~ (string: String) -> String {
    return NSLocalizedString(string, comment: "")


Tip #2: easy testing

You can change the language of your app by modifying your Scheme. Select your scheme and click Edit Scheme…

Then in Options tab select Application Language that you want to test.

Part II: Managing localizations

Now your application is set up and you know the basics of localization process on iOS, so let’s see what’s the fuzz is all about. Imagine thousands of keys across tens of language files, making sure all are in sync, are translated and proofread. Pretty scary, huh? We’ve built Lokalise to help you avoid all the chaos.

Step 1: Create a project in Lokalise

Once you sign up to Lokalise, just tap “Add another project” button (or explore the Sample Project if you wish to get more familiar with Lokalise features first). Give your project a name and optionally a description. You can change the base language setting later if you change your mind about it.

Each project has a unique ID (you can see it in project settings), that is used when referring to a project over API.

Step 2: Upload your files or add new keys

Import your .strings file to Lokalise. Click upload and drag Localizable.strings to drop area. Alternatively, you can do it the other way – start by adding keys in Lokalise first.

Step 3: Invite team members

Getting localization work done quick requires a team of contributors. Switch to the Contributors section by clicking the icon in the project’s icon bar and start adding teammates. Any user can be granted admin privileges, i.e. the same rights on the project as you. If a user is not an admin, you can specify per-language access to the project specifying some languages as reference (read-only) or contributable (read and update). Only admins have access to key modification, importing, exporting, settings, etc.

Step 4: Edit!

Lokalise editor is feature-packed. We’ve worked hard to deliver light and responsive interface while still offering all the features you would need while working with app or web project copy. Feel free to explore Sample Project or just take a look at Documentation to read about the basic concepts and options.

Part III: Integrating with your project

Finally, the translation part is done. How to get the information out of Lokalise and make it usable in your app? There are four options, choose the one you prefer:

Option 1: Download the files

Click Download icon in your project icon bar and select Apple Strings as the exporting format. Click Build and download to finish and get the file. Then move .lproj folders from the downloaded archive into your project replacing the existing localization, that’s it.

Option 2: Use Fastlane actions we’ve built

If you are using Fastlane, then use lokalise.rb provided in this Github repository. Let us know in support chat if you have additional questions related to the action scripts.


Option 3: Use API or CLI tool

Depending on your project deployment setup, you may want to use either Lokalise API or the CLI tool – both approaches give you a simple way to automatically generate and download localization files.


Option 4: Integrate using Lokalise iOS SDK

Using our framework gives an opportunity to update your app texts over-the-air without the need to resubmit for Appstore review. Please refer to Lokalise iOS SDK instructions.

The displayed logo is is a trademark of Apple Inc. Lokalise is an independent product and has not been authorized, sponsored, or otherwise approved by Apple Inc.

Related posts

Sign up to our newsletter

Get the latest articles on all things localization and translation management delivered straight to your inbox.

Read also
Localization made easy. Why wait?
The preferred localization tool of 2000+ companies