Skip to content

Translate iOS Apps with Xcode .strings Support

Seamlessly localize your iOS, macOS, watchOS, and visionOS applications with Lingo.dev's support for Xcode's traditional .strings format.

Quick Setup

Configure your project in three simple steps:

  1. Create an i18n.json configuration file
  2. Specify your source and target languages
  3. Point to your .strings files using the [locale] placeholder
json
{
  "version": 1.2,
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de"]
  },
  "buckets": {
    "xcode-strings": {
      "include": ["MyApp/[locale].lproj/Localizable.strings"]
    }
  }
}

TIP

The [locale] placeholder automatically expands to the appropriate language code for each target language.

Understanding .strings Files

Xcode's .strings format uses a simple key-value structure:

"key" = "value";

Where:

  • key: The identifier used in your code
  • value: The human-readable text to be translated

One Command Translation

Translate all your strings with a single command:

bash
npx lingo.dev@latest i18n

This command:

  • Processes your source language .strings file
  • Creates or updates target language files
  • Preserves file structure and formatting

Key Features

1. Format Preservation

  • Comments: All comments are maintained exactly as written
  • Special Characters: Proper handling of escape sequences (\n, \", etc.)
  • Formatting: Spaces, indentation, and line breaks remain intact

2. Smart Processing

  • Incremental Updates: Only translates new or modified strings
  • Format Placeholders: Correctly handles all Xcode format specifiers (%@, %d, etc.)
  • Automatic File Creation: Generates target language files in the correct directory structure

Real-World Example

Here's a typical .strings file with various elements:

// General UI elements
"greeting" = "Hello!";
"welcome_user" = "Welcome, %@!";

// Plurals (handled in .stringsdict)
"items_count" = "%d items";

// Complex formatting
"complex_format" = "User %1$@ has %2$d points and $%3$.2f balance";

Advanced Techniques

Multiple Files Support

Include all your project's .strings files in a single configuration:

json
"xcode-strings": {
  "include": [
    "MyApp/[locale].lproj/Localizable.strings",
    "MyApp/[locale].lproj/InfoPlist.strings"
  ]
}

Pluralization

For proper pluralization support:

  1. Use .stringsdict files alongside .strings (see our .stringsdict documentation)
  2. Lingo.dev handles both formats seamlessly

Workflow Integration

  • Version Control: Commit both source and translated files
  • CI/CD: Use the --frozen flag to verify translations in your pipeline
  • Xcode Integration: Translated files work directly with Xcode's built-in localization system

By integrating Lingo.dev into your iOS development workflow, you can maintain high-quality translations across all Apple platforms with minimal effort.

For other Apple localization formats, see our guides for .xcstrings and .stringsdict files.