Export Localizations from Xcode (.xcloc): Bundle Anatomy & Round-Trip

By The strings.dev team · Last updated

Frequently asked questions

How do I export localizations from Xcode as an .xcloc?

In Xcode, choose Product > Export Localizations… (on some versions Editor > Export Localizations…), tick the languages already configured under Project > Info > Localizations, and pick an output folder — Xcode writes one .xcloc per language, named by locale code. From the command line, run xcodebuild -exportLocalizations -project MyApp.xcodeproj -localizationPath ./Localizations -exportLanguage fr, which produces the identical bundle for CI use.

How do I open an .xcloc file?

An .xcloc is a directory bundle, not a single file. In Finder, right-click it and choose Show Package Contents to browse the tree. In Terminal, cd into it and run find . -type f. The editable file is Localized Contents/<locale>.xliff — plain XLIFF 1.2 XML you can open in any editor. To re-open it inside Xcode, use Product > Import Localizations…

What is the .xcloc file format made of?

It's a bundle containing contents.json (metadata with the target locale, tool info, and format version), a Localized Contents folder with the editable <locale>.xliff (XLIFF 1.2, one trans-unit per string), a Source Contents folder with read-only copies of your resources including Localizable.xcstrings, and an optional Notes folder for translator screenshots. Only the XLIFF should be edited.

How do I import translated XLIFF back into Xcode?

Once the XLIFF's <target> elements are filled, run xcodebuild -importLocalizations -project MyApp.xcodeproj -localizationPath ./Localizations/fr.xcloc once per locale, or use Product > Import Localizations… in the GUI for a review sheet. Xcode matches each string back to its Localizable.xcstrings entry by trans-unit id, so the round-trip is lossless.

Do I need to convert the XLIFF to translate iOS strings?

No. The whole point of the .xcloc round-trip is that the format stays native: same bundle out of Xcode, same bundle back in. strings.dev takes the .xcloc Xcode exports and returns a completed .xcloc — placeholders, positional arguments, and String Catalog plural variations preserved — which you feed straight back into xcodebuild -importLocalizations. No XLIFF-to-CSV conversion that could corrupt your data.

Can I automate the .xcloc export and import in CI?

Yes. Both xcodebuild -exportLocalizations and xcodebuild -importLocalizations run headlessly, so you can script the export, send the .xcloc through strings.dev's CLI or REST API for the translate step, and import the result — all in a CI stage or git hook. This keeps translations in sync with every release instead of lagging behind code changes.

Related

Round-trip your first .xcloc free