How to Localize All Your iOS Apps into 20 Languages in 5 Minutes
In today's globalized world, the demand for mobile applications that cater to users from different countries and regions has increased significantly. To reach a wider audience, it's important for iOS application developers to make their apps accessible to users in multiple languages. Localizing an iOS app can offer many benefits:
- Reach a wider audience: By localizing your app, you can reach users who may not speak your app's default language. This can help you tap into new markets and increase your user base.
- Improve user experience: Users are more likely to use and enjoy an app that is available in their native language. Localizing your app can help you provide a better user experience, which can lead to better reviews, ratings, and retention rates. Localizing your app can give you a competitive advantage in regions where your competitors may not have localized their apps.
- Increase revenue: Localizing your app can lead to increased revenue, as users are more likely to make in-app purchases or pay for subscriptions if the app is available in their native language.
But there are also a few problems and potential issues that developers may run into. Localizing an app can be time-consuming and resource intensive, especially for apps with a large amount of content and a long list of languages. Developers must allocate sufficient time and resources to ensure effective localization.
But we wouldn't be developers if we didn't always try to automate everything. Automated localization can translate content quickly and efficiently, reduce the costs associated with manual translation, such as hiring professional translators or dedicating internal resources to the task. This is especially effective if the application is being created by a single developer.
Prepare your project
I won't go into detail about how localization of strings works in xcode project, there are already many other tutorials. I'll just highlight a few key steps:
- Create Localizable.strings file and fill it with strings you want to localize.
/* optional description */ "[key]" = "[string]"; /* Example: */ "welcome text" = "Welcome to XCodeLocalize";
- Go to the project file settings, add the desired languages. Apple recommended EFIGS (English French Italian German Spanish) + Chinese as a base.
- Create Localizable.strings files for all selected languages. You may also want to localize plist, storyboard and intentdefinition files.
Unexpectedly, the ios development tool turned out to be written in python, so make sure you have python 3.9+
After that, install the tool using pip:
pip3 install xcodelocalize
Run automatic localization
cd to the project root folder and run
python3 -m xcodelocalize [OPTIONS]
--base-language: code of the language from which all strings will be translated. [default: 'en']
--override / --no-override: a boolean value that indicates whether strings that already exist in the file will be translated. Retranslate if
override, skip if
no-override. [default: no-override]
--format-base / --no-format-base: sort base file strings by key. [default: no-format-base]
--file: Names of the strings files to be translated. Multiple files can be specified. If not specified, all files will be translated. [default: None] Example:
xcodelocalize --file InfoPlist xcodelocalize --file InfoPlist --file MainStoryboard --file Localizable
--key: Keys of the strings to be translated. Multiple keys can be specified. If not specified, all keys will be translated. [default: None]
--language: Language codes of the strings files to be translated. Multiple language codes can be specified. If not specified, all files will be translated. [default: None]
--log-level: One from [progress|errors|group|string]. [default: group]
--help: Show info
You can go to
Target -> Build Phases -> New Run Script Phase in your xcode project and paste
xcodelocalize there. It will localize necessary strings during every build and your localization files will always be up-to-date.
Now you know how to quickly localize your iOS applications in many other languages. Add a star to the repo if you like it.
- S.T.A.R.K - The First Voice Assistant's Framework— September 20th, 2023 · 2 min readI published a framework that allows you to build your own amazing voice assistant.
- Inside MajorDom v1.0: Exploring the Architecture of a New Smart Home System— June 1st, 2023 · 3 min readExploring the Architecture of MajorDom v1.0: Dive into the inner workings of MajorDom v1.0. Learn about its core components, fault tolerance and offline capabilities.
- Building a Smart Home - from Voice Assistant to MajorDom v1.0— May 26th, 2023 · 5 min readThe story of the origin of MajorDom: how I started creating my voice assistant and how it grew into a smart home system.