Localize Your Xcode Application With XLIFF

Xcode is the default IDE for Objective-C or Swift of Apple's ecosystem. Localization for Xcode used to work solely with the Strings format. It is now possible to work with the XML Localization Interchange File Format (XLIFF). Learn How to integrate a workflow with PhraseApp.

Short note: This article covers iOS SDK 8.1 developed in Xcode 6.1. Other versions should work fine, too.

Your Basic Setup

Localization in Xcode can be done easily with the Strings format. Before we dig any deeper you should check out the documentation on iOS with PhraseApp setup. With the XLIFF format you now have the possibility to group your .strings files into larger XLIFF language files. For example all your .strings for English will be put into a singleen.xliff file. No more cluttered .strings files in your project!

Sample XLIFF file:

Workflow

The localization workflow itself is different to the usual Strings workflow:

xcode-workflow

Export your localization files by clicking on your project. Then Editor > Export For Localization. Within this folder all your translations reside as a .xliff file. It is best to upload and download your files to and from PhraseApp from this folder. Import your localization files by clicking on your project. Then Editor > Import Localizations. Let’s say you exported your files from the Xcode project and uploaded some translations to PhraseApp. If you have new translations download them to your translation export folder. Then just import the translations back into your application by using Xcode’s import feature.

Pluralization

Unfortunately XLIFF does not support pluralization. For that reason Xcode uses the Stringsdict format. If you want to pluralize your app you will need to work with the two formats simultaneously. You can still work with XLIFF as suggested before.

Additionally you will need to set up PhraseApp for the .stringsdict files as well.

Uploading Your Translations To PhraseApp

Uploading your files to PhraseApp leaves you open with two options. The first one is via the translation center:

xliff-translation-center

The second one is for your developers by using the command-line client with the phrase Gem

If you want to upload a specific XLIFF file for example English (en) simply type

If you would like to download your translations for English simply type

Next Steps

With a working PhraseApp setup your application is good to go. You can start the translation process by managing your keys in the translation center, ordering translations or by collaborating with your translators and developers.

Further Reading


Also published on Medium.

Comments