
Research
/Security News
Coruna Respawned: Compromised art-template npm Package Leads to iOS Browser Exploit Kit
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.
ai-i18n-sync
Advanced tools
AI-powered i18n translation sync tool. Detect missing keys → Translate → Sync.
AI 驱动的国际化翻译同步工具 —— 检测缺失 key → AI 翻译 → 同步写入,一条命令搞定。
English | 中文
common.buttons.submit 嵌套结构translate 命令秒级翻译单条文本npx 直接用# 1. 配置 API Key
echo 'DEEPSEEK_API_KEY=sk-xxx' >> .env.local
# 2. 同步翻译
npx ai-i18n-sync sync --source locales/zh.json --targets en,ja
# 3. 检查完整性
npx ai-i18n-sync check
# 方式一:项目级安装
npm install -D ai-i18n-sync
# 方式二:全局安装
npm install -g ai-i18n-sync
# 方式三:npx 直接用
npx ai-i18n-sync
安装后可使用短名 ai-i18n 替代 ai-i18n-sync。
sync — 同步翻译以主语言文件为基准,AI 翻译缺失的 key 并写入目标文件。
npx ai-i18n sync --source locales/zh.json --targets en,ja
npx ai-i18n sync --source zh.json --targets en.json --dry-run
npx ai-i18n sync --context "跨境电商平台"
| 参数 | 说明 |
|---|---|
--source <file> | 主语言文件路径 |
--targets <list> | 目标语言(逗号分隔:en,ja,ko 或文件路径) |
--context <text> | 翻译上下文(提升翻译准确度) |
--dry-run | 只展示,不写入文件 |
$ npx ai-i18n sync --source locales/zh.json --targets en
🔍 正在扫描 i18n 文件...
📄 Source: zh.json (142 keys)
📄 Target: en.json (130 keys) ⚠️ 12 missing
📋 发现 12 个缺失 key (en.json):
+ mall.order.refund_pending "退款审核中"
+ mall.order.refund_approved "退款已通过"
+ mall.coupon.claim_success "领取成功"
... (9 more)
🤖 正在翻译 12 个 key → en...
mall.order.refund_pending: "退款审核中" → "Refund Under Review"
mall.order.refund_approved: "退款已通过" → "Refund Approved"
mall.coupon.claim_success: "领取成功" → "Claimed Successfully"
... (9 more)
✅ 已同步 12 个 key → en.json
🎉 翻译同步完成,共 12 个 key。
check — 检查完整性npx ai-i18n check
npx ai-i18n check --strict # 多余 key 也报错
🔍 正在检查 i18n 完整性...
zh.json 142 keys (source)
en.json 130 keys ⚠️ 12 missing
ja.json 128 keys ⚠️ 14 missing
ko.json 142 keys ✅
❌ 存在缺失 key,运行 `ai-i18n sync` 修复。
translate — 快速翻译npx ai-i18n translate "用户管理" --to en,ja
npx ai-i18n translate "退款审核" --to en --context "电商平台"
🤖 翻译: "用户管理"
en: User Management
ja: ユーザー管理
init — 初始化配置npx ai-i18n init # 生成 .ai-i18n.json + .ai-i18n-glossary.json
运行 ai-i18n init 生成 .ai-i18n.json:
{
"sourceLocale": "zh", // 主语言
"targetLocales": ["en"], // 目标语言列表
"localesDir": "src/locales", // i18n 文件目录
"filePattern": "{locale}.json", // 文件命名规则
"nested": true, // 嵌套结构
"sortKeys": false, // 输出时 key 排序
"context": "", // 翻译上下文
"glossary": ".ai-i18n-glossary.json", // 术语表路径
"batchSize": 30, // 每次 API 调用翻译的 key 数
"model": "" // 指定模型
}
.ai-i18n-glossary.json 确保专业术语翻译一致:
{
"zh-en": {
"订单": "Order",
"优惠券": "Coupon",
"购物车": "Shopping Cart",
"退款": "Refund"
},
"zh-ja": {
"订单": "注文",
"优惠券": "クーポン"
}
}
| Provider | 默认模型 | 环境变量 |
|---|---|---|
| OpenAI | gpt-4o-mini | OPENAI_API_KEY |
| DeepSeek | deepseek-chat | DEEPSEEK_API_KEY |
| Claude | claude-sonnet-4-20250514 | ANTHROPIC_API_KEY |
| 通义千问 | qwen-plus | DASHSCOPE_API_KEY |
| Gemini | gemini-2.0-flash | GEMINI_API_KEY |
| Ollama | qwen2.5-coder | 无需 Key |
兼容 AI_REVIEW_* 系列环境变量。
ai-review-pipeline ── 代码质量审查
ai-git-msg ── 提交信息生成
ai-i18n-sync ── 国际化翻译同步
An AI-powered i18n translation sync tool. Detects missing keys → AI translates → Writes to target files. Supports glossary for consistent terminology.
echo 'DEEPSEEK_API_KEY=sk-xxx' >> .env.local
npx ai-i18n-sync sync --source locales/zh.json --targets en,ja
| Command | Description |
|---|---|
sync | Translate and sync missing keys to target locales |
check | Check locale files for missing/extra keys |
translate | Quickly translate a text string |
init | Initialize config and glossary files |
npm install -D ai-i18n-sync
npx ai-i18n-sync
MIT
FAQs
AI-powered i18n translation sync tool. Detect missing keys → Translate → Sync.
We found that ai-i18n-sync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.

Company News
As AI accelerates how code is written and shipped, Socket is scaling to protect the software supply chain from the growing wave of attacks targeting open source dependencies.

Company News
Socket is scaling to defend open source against supply chain attacks as AI accelerates software development.