The Xcode String Catalog (.xcstrings) File Format Explained

By The strings.dev team · Last updated

Frequently asked questions

What is an .xcstrings file?

It is an Xcode String Catalog: a single JSON file, introduced in Xcode 15, that stores all of an Apple app target's localizable strings and their translations. It replaces the older .strings and .stringsdict files with one structured, git-friendly document.

How do I open an .xcstrings file?

In Xcode, double-click it to open the visual String Catalog editor. Because it is plain JSON, you can also open it in any text editor to inspect the sourceLanguage, strings, and version keys directly — though editing translations is safer through Xcode or by round-tripping an exported .xcloc bundle.

What is the difference between .xcstrings and a .strings file?

A .strings file is a flat key/value text file with one file per language, and plurals require a separate .stringsdict. An .xcstrings catalog is a single JSON file holding every language at once, stores plurals inline under variations.plural, and tracks a translation state for each string.

What do the state values in a String Catalog mean?

The state on each translation's stringUnit reflects its status: new means untranslated, translated means present and accepted, and needs_review means the source changed after translating so the value should be verified. A separate per-string extractionState of stale marks source strings no longer referenced in your code.

How are plurals stored in an .xcstrings file?

Instead of a single stringUnit, the localization holds a variations object with a plural key, and each CLDR plural category (one, other, and where the language requires them zero, two, few, many) gets its own stringUnit value. This is what the String Catalog editor's Vary by Plural option produces.

Related

Localize your String Catalog free