xct is a CLI util to machine-translate Apple String Catalog (.xcstrings).
💫 I personally use this for my app Replay, check it out!
- Machine-translate .xcstrings to target locales via Copilot CLI.
- Importing translated CSV back into .xcstrings.
- Auto-filling zh-Hans from zh-Hant with OpenCC.
- Node.js
>=18 copilotCLI inPATH. Learn more
npm install -g xcstrings-translateOr run without installing:
npx xcstrings-translate --help💡 Turn on "Automatically generate string catalog comments" in XCode for best machine translation results.
xct ./Localizable.xcstrings --auto fr,itOptions:
--out <directory>- Directory for temporary CSV files.
- Defaults to the OS temp directory (
os.tmpdir()), so it is cross-platform.
--export-only- Export temp CSV files only, skip translation/import.
--chunk-size <n>- Number of rows per temp CSV chunk.
- Default:
100.
--model <name>- Optional model override for auto-translation.
- Default:
claude-haiku-4.5. - Recommend to use 0.33x models for best results. For no usage drain, use 0x models like
gpt-4.1
--retranslate-matching <regex>- Only process keys matching the regex.
xct ./Localizable.xcstrings --import ./translations_fr.csvxct ./Localizable.xcstrings --cc zh-Hans
xct ./Localizable.xcstrings --cc zh-HantOptions:
--cc zh-Hans: fill missingzh-Hansfromzh-Hant--cc zh-Hant: fill missingzh-Hantfromzh-Hans
bun install
bun run checkMIT. See LICENSE.