
attranslate
CLI面向编码 agent 的离线翻译同步工具:只把 JSON、YAML、PO、CSV 等多语言文件里新增的文案交给 agent 翻译,不覆盖人工改过的译文,省 token。适合译员与开发协作维护软件译文;需要 Node.js,本身不调用翻译 API。
attranslate: Translation-sync for Agents
attranslate is a CLI-tool for syncing translation files (JSON/YAML/XML) designed to assist Coding Agents in translating efficiently with minimal token-usage.
Existing translations remain unchanged; only new strings are synchronized.
As of v3, attranslate is a complete offline-tool; it does not call into any translation-APIs anymore, instead it acts as an efficiency-helper for agents that do the main work.
Preserve Manual Translations
attranslate recognizes that agentic translations are not always perfect.
Therefore, whenever you are unhappy with the produced text, attranslate allows you to simply overwrite text in your target-files.
attranslate will never overwrite any manual corrections in subsequent runs.
How It Works: Agentic Invocation
To help agents in a token-efficient way, attranslate uses a trick of making itself "double-invoked" by agents. In the first invocation, attranslate will print a list of missing sources and instructions for the agent. Example:
$ attranslate --srcFile=en.json --srcLng=English --format=json --targetFile=es.json --targetLng=Spanish --service=agent
Invoke 'agent' from 'English' to 'Spanish' with 2 inputs...
MISSING TRANSLATIONS:
- key: hello
source: Hello
- key: bye
source: Goodbye
INSTRUCTIONS FOR AGENTS:
Translate the missing sources listed above, matching the order.
Replace <translation1>, <translation2>, ... with your actual translated strings and pipe them into attranslate as follows:
echo -e "<translation1>\n<translation2>\n..." | attranslate --srcFile=en.json --srcLng=English --format=json --targetFile=es.json --targetLng=Spanish --service=agent
The agent then naturally follows those instructions to finish the job in a second invocation of attranslate:
$ echo -e "Hola\nAdiós" | attranslate --srcFile=en.json --srcLng=English --format=json --targetFile=es.json --targetLng=Spanish --service=agent
Invoke 'agent' from 'English' to 'Spanish' with 2 inputs...
Add 2 new translations
Write target '/path/to/es.json'
Note: the first (no-pipe) run exits with a non-zero code by design, which can be used in CI/CD to detect missing translations.
Installation
Install globally:
npm install --global attranslate
Or in a Node.js project:
npm install --save-dev attranslate
Prompt Examples
It is recommended to add instructions for invoking attranslate to your agentic instructions (e.g. an agent-skill). For example:
Invoke `attranslate` after adding a new translation to the English en.json:
attranslate --srcFile=translations/en.json --targetFile=translations/es.json --targetLng=Spanish --srcLng=English --format=json --service=agent
attranslate --srcFile=translations/en.json --targetFile=translations/de.json --targetLng=German --srcLng=English --format=json --service=agent
Usage Options
Run attranslate --help to see a list of available options:
Usage: attranslate [options]
Options:
--srcFile <sourceFile> The source file to be translated
--srcLng <sourceLanguage> The source language
--targetFile <targetFile> The target file for the translations
--targetLng <targetLanguage> The target language
--format <format> One of "flat-json", "nested-json", "json", "yaml", "po", "xml", "ios-strings", "arb", "csv"
--service <translationService> "agent"
-v, --version output the version number
-h, --help display help for command
相關資源

Lingo.dev CLI
CLILingo.dev 官方命令行:lingo push 把仓库里的 JSON、YAML、Markdown、PO、XLIFF、Android/Xcode 字符串等文件发给平台上的大模型本地化引擎翻译,lingo pull 取回译文,可接入 CI。需 Lingo.dev 账号,按量计费,有免费沙箱。
lingodotdev/lingo.dev5.4k
Languine
CLIAI 本地化工具:先把服务端一键部署到自己的 Vercel 账号(自动配好 Postgres 与 AI Gateway,部署后需开启部署保护),再在项目里运行 npx languine@selfhosted translate,用大模型把应用的语言文件翻译成多个语种,也提供自动提 PR 的 GitHub Action。需要 Vercel 账号与 Node.js。
languine-ai/languine2k
Crowdin CLI
CLICrowdin 官方命令行:把待翻译的源文件上传到 Crowdin,再把译文下载回原位置,还能查看翻译进度、管理术语表与翻译记忆、触发机器或 AI 预翻译,支持 JSON 输出便于 agent 解析。需要 Crowdin 账号(可免费试用,开源项目可申请免费授权)与个人访问令牌,crowdin init 会引导生成配置文件。
crowdin/crowdin-cli321
Lokalise CLI v2
CLILokalise 官方命令行(lokalise2),覆盖 Lokalise API v2:上传和下载语言文件,管理词条、译文、截图、翻译任务与贡献者,方便把翻译进度同步到项目里。需要 Lokalise 账号(付费服务,可免费试用 14 天),在个人资料页生成 API Token 后用 --token 传入。
lokalise/lokalise-cli-2-go124
SimpleLocalize CLI
CLISimpleLocalize 官方命令行:上传、下载多语言翻译文件,一键发起机器翻译与 AI 自动翻译,把译文发布到 CDN 托管,还能从源码中抽取待翻译的文案键,适合放进 CI 自动跑本地化流程。需要 SimpleLocalize 账号与项目 API Key,平台为付费服务,可免费试用 14 天。
simplelocalize/simplelocalize-cli80
locize-cli
CLILocize 官方命令行:在本地多语言文件与 Locize 翻译平台之间同步,增删查翻译条目、下载已发布译文、管理版本与分支,可导出 JSON、XLIFF、PO、CSV、Excel 等格式交给译员处理。需要 Locize 账号、项目 ID 与 API Key,有免费套餐。
locize/locize-cli71