XCStrings Format Overview
String Catalogs (.xcstrings) are JSON files that store all your app's localizable strings. Introduced in Xcode 15, they consolidate all languages, plurals, and device variations into one file.
File Structure#
An .xcstrings file has this basic structure:
{
"sourceLanguage": "en",
"version": "1.0",
"strings": {
"welcome_message": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Welcome to the app!"
}
},
"de": {
"stringUnit": {
"state": "translated",
"value": "Willkommen in der App!"
}
}
}
}
}
}Key Properties#
| Property | Description |
|---|---|
sourceLanguage | The development language (usually "en") |
strings | Object containing all string keys |
localizations | Translations for each language |
stringUnit | The actual translation with state and value |
variations | Optional plural or device-specific variations |
How Xcode Manages String Catalogs#
When you build your project, Xcode:
- Extracts strings from
Text(),String(localized:), and other APIs - Adds new keys with state
"new" - Marks strings as
"stale"if the source text changes - Preserves existing translations
Enable "Use Compiler to Extract Swift Strings" in your target's build settings for the most accurate extraction.
Next Steps#
- Translation States — Understanding new, translated, stale, and needs_review
- Pluralization — Handling "1 item" vs "5 items"
- Device Variations — Platform-specific text
Still using .strings files? See Migrating from Localizable.strings for a step-by-step guide.