Main menu

Loco support for iOS strings files and Xcode localizations

Import and export of iOS strings is supported with the following features:

Localizable.strings

The simplest workflow is to manage your strings files directly. Once you've imported your strings, you can translate them within Loco and pull them into your Xcode build whenever you need to update it.

For example: A simple Terminal command using wget or curl is all you need to save your strings file directly into your Xcode project:

wget https://localise.biz/api/export/locale/en.strings?key=<KEY>` -O en.lproj/Localizable.strings
wget https://localise.biz/api/export/locale/fr.strings?key=<KEY>` -O fr.lproj/Localizable.strings
  • See the export API for more detail on how to automate the export of your strings files.
  • If you have multiple strings files, you may wish to tag your assets or manage them as separate projects.

XLIFF

Xcode's "Export for Localization..." option creates an English en.xliff file which can be imported into Loco for translation.

To export the localized XLIFF file you should specify Loco's iOS-specific XLIFF format. You can then import this file using Xcode's "Import Localization..." option

The following Terminal example shows the xcode parameter being specified instead of the generic XLIFF export.

wget https://localise.biz/api/export/locale/fr.xliff?key=<KEY>&format=xcode`

Plural forms

Plurals are managed in the main Loco interface the same way for all platforms, but managing plural forms into Xcode has been changing over the years. Loco provides a number of ways to work with iOS plural forms.

  • Separate strings
    If you're using a custom library such as TTTLocalizedPluralString to handle plurals, just name your Loco assets appropriately and export .strings files directly into your Xcode project.

  • .stringsdict
    If you're using Foundation's plural support (as of iOS 7) you can export a Localizable.stringsdict file from Loco which contains only the pluralized strings in your project. This is generally used if you're exporting .strings files directly.

  • XLIFF
    As of Xcode 9, XLIFF files have a <file> section corresponding to .stringsdict definitions. Loco can import and export plural rules embedded in XLIFF.

Read more about plural forms in Loco