---
title: "#183: Importing/Exporting .xliff Translation Files 📝🌎"
url: https://littlebitesofcocoa.com/183-importing-exporting-xliff-translation-files
author: Jake Marsh
date: 2016-02-03
published: 2016-02-03
topics: ["Localization","Tools"]
description: "Today we'll continue our localization series with a lesser-known Xcode feature that makes the process of translating our apps easier."
---

# #183: Importing/Exporting .xliff Translation Files 📝🌎

By Jake Marsh, February 3, 2016. HTML: https://littlebitesofcocoa.com/183-importing-exporting-xliff-translation-files

Today we'll continue our localization series with a lesser-known **Xcode** feature that makes the process of translating our **apps** easier. Usually we won't be translating our **apps** ourselves, at least not into <i>all</i> the languages we want to support.

It's common to send our strings off to a **third-party service**, who will translate them and return them to us. Let's get started.

In [Bite #181](https://littlebitesofcocoa.com/181), we enabled the basic localization features of **Xcode**. As we work on our **app**, we'll add new **strings**:

``` swift
button.setTitle(
  NSLocalizedString("fly-here", comment: "Fly Here"),
  forState: .Normal)
```

When we do, we <i>could</i> manually add the new **key** to all of the different language versions of our **Localizable.strings** file.

We could also generate a <i>brand new</i> **Localizable.strings** file using Apple's `genstrings` command-line tool. Running `gentrings *swift` in our project's root directory will scan our code and generate a new **Localizable.strings** file with all the **NSLocalizedString** **keys** we've used.

That sounds like it could lead to lots of manual diff'ing.

<img src='https://media.littlebitesofcocoa.com/bite-assets/183-importing-exporting-xliff-translation-files-xliff-icon.png' style='max-width: 126px; float: right; margin-left: 20px; margin-bottom: 20px;' />

It turns out that **Xcode** itself actually has a more powerful feature that can export our strings for translation with almost no manual labor. It pulls from all our **Storyboards**, **.xibs**, <i>and</i> scans our code for **NSLocalizedStrings**. 

To use it, we'll select our **project** at the top of the **Project Navigator**, and then select **Editor** > **Export for Localization...** This will export a folder full of `.xliff` files for all the languages we've added to our project in Xcode.

<img src='https://media.littlebitesofcocoa.com/bite-assets/183-importing-exporting-xliff-translation-files-export.png' style='max-width: 427px;' />

This format is standard for most translation services. We'll find a service, then upload these files to them. They'll return us a similar set of files, filled with our translated strings. When they do we'll select **Editor** > **Import Localizations...** option then import them back into **Xcode**. 

Popular translation services like [Babble-on](https://www.ibabbleon.com/app_localization.html) and [Applingua](https://applingua.com/)  specialize in mobile apps and support `.xliff` files. We could also edit the files ourselves using a tool like [iXLIFF](https://itunes.apple.com/us/app/ixliff/id944658897?mt=12).
