Lingo.dev + .xcstrings (Xcode)

Lingo.dev CLI translates Xcode .xcstrings files while preserving pluralization rules, device variations, and iOS-specific metadata. The CLI works directly with Xcode's localization workflow, generates code-accessible string constants, handles complex iOS pluralization rules automatically, supports platform-specific string variations, and integrates seamlessly with Xcode build processes.

Quick Setup

Configure for Xcode's modern string catalog format:

{
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de", "ja"]
  },
  "buckets": {
    "xcode-xcstrings": {
      "include": ["Resources/Localizable.xcstrings"]
    }
  }
}

Translate String Catalogs

npx lingo.dev@latest i18n

Automatically handles pluralization, device variations, and Xcode-specific metadata while preserving iOS conventions.

String Catalog Features

Basic Localization

{
  "sourceLanguage": "en",
  "strings": {
    "welcome_message": {
      "localizations": {
        "en": {
          "stringUnit": {
            "state": "translated",
            "value": "Welcome to our app!"
          }
        }
      }
    }
  }
}

Plural Variations

{
  "item_count": {
    "localizations": {
      "en": {
        "variations": {
          "plural": {
            "zero": {
              "stringUnit": {
                "state": "translated",
                "value": "No items"
              }
            },
            "one": {
              "stringUnit": {
                "state": "translated",
                "value": "%d item"
              }
            },
            "other": {
              "stringUnit": {
                "state": "translated",
                "value": "%d items"
              }
            }
          }
        }
      }
    }
  }
}

Device Variations

Supports device-specific strings for iPhone, iPad, Apple Watch, and other Apple platforms.

Format Preservation

  • Metadata Intact: State, comments, and extraction state preserved
  • Variations Safe: All plural and device variations maintained
  • Structure Preserved: JSON hierarchy and Xcode-specific keys unchanged
  • Placeholder Safe: iOS format specifiers like %@, %d maintained

Advanced Configuration

Multiple Catalogs

"xcode-xcstrings": {
  "include": [
    "Resources/Localizable.xcstrings",
    "Resources/InfoPlist.xcstrings"
  ]
}

Lock System Keys

"xcode-xcstrings": {
  "include": ["Resources/Localizable.xcstrings"],
  "lockedKeys": ["CFBundleName", "NSHumanReadableCopyright"]
}

Translator Notes

Xcode .xcstrings files support translator notes through the comment field in string entries. These notes provide essential context to AI models during translation, helping them understand the intent and usage of each string.

{
  "strings": {
    "light_mode": {
      "comment": "UI theme setting - refers to brightness, not weight",
      "localizations": {
        "en": {
          "stringUnit": {
            "state": "translated",
            "value": "Light Mode"
          }
        }
      }
    },
    "records_label": {
      "comment": "Medical context: patient health records, not audio recordings",
      "localizations": {
        "en": {
          "stringUnit": {
            "state": "translated",
            "value": "View Records"
          }
        }
      }
    }
  }
}

To learn more, see Translator Notes.