Skip to content

theleftbit/XCStringsAITranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xcstrings-ai-translate

Swift CLI utility to translate Xcode String Catalogs (.xcstrings) into a target locale using FoundationModels (Apple Intelligence / on-device model).

  • Input: .xcstrings
  • Output: .xcstrings (overwrite by default, or write to --output)
  • Uses sourceLanguage from the file as the source locale
  • Translates every key under strings
  • Overwrites existing translations for the target locale
  • Preserves the original strings key order
  • Skips entries that contain variations (not supported yet)
  • Preserves placeholders (%@, %d, %1$@, \(value), {name}…), retries on mismatch
  • Logs each key as it translates
  • On errors/refusals/placeholder mismatch: keeps source text for target locale and marks it as needs_review

Requirements

  • macOS 26+
  • Apple Silicon
  • Apple Intelligence / system model available on the machine
  • Xcode 26+ (recommended)

Build

git clone <your-repo-url>
cd xcstrings-ai-translate
swift build -c release

Binary

.build/release/xcstrings-ai-translate

Usage

xcstrings-ai-translate <input.xcstrings> <target-locale> [--output <path>]

Examples

.build/release/xcstrings-ai-translate \
  /path/to/Localizable.xcstrings \
  it

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages