
Intro
If you want to make worldwide-known app available in dozens of countries you should adapt your app to different languages. It is much more convenient for user to have app in his/her native language.
I want to share how to improve your iOS localization process.
Part I: Add Internationalization to your project
Enabling Base Internationalization
First off all, you should enable project localization.
- In the
Project Navigator
, select the project - Click
Info
tab - Check on
Use Base Internationalization

After that you can add new languages by tapping "+"
icon (above “Use Base Internationalization”)
For more details check this step-by-step guide or documentation.
Create Localizable.string
- Create New String File named Localizable (
New File
→String File
). - In
File Inspector
(right panel) click onLocalize..
button.
It’s your Localizable.strings file for Base language.
The syntax of this file is:
So now it’s a time to improve our localization handling!
Part II: Localizable Management
For using a localized string programmatically, you should use the NSLocalizedString
function:
In brief, by calling the key programmatically NSLocalizedString
func returns the localized value.
But for managing all localized strings we need more type-safe approach that helps to avoid calling hardcoded strings.
First of all,
Split all localized strings by pages or by meaning, and create an enum for each part
Secondly, create LocalizableDelegate protocol which we will use in enums:
So LocalizableDelegate
has 3 variables. table
is the name of table where to search specific key. localized
returns a value by rawValue
located in the table
. By default table
is nil, it means that the localizedString
method attempts to use the table Localizable.strings
.
The next step, is to adopt LocalizableDelegate
in enum
You can use specific file for each View
or ViewController
. In this case you have to declare table
variable:
Example of usage:
I have created Localizable
enum containing all localization enums
Advantages
- Type-safe approach that helps to avoid calling hardcoded strings;
- Manage all localized strings from one place;
- Simplified change of localizable value;
- You can refer to one localized string from more than one enum.

Thanks for reading.
I hope these iOS localization tips can help you improve your workflow.
Check my articles: how to create own custom xCode Template or Countdown Timer in Swift 5 for iOS.
You may check my apps.
If you have any questions or found any errors, please drop me a line!
Written with ❤️ by Rita