如何 运作
深入了解 TranslateBot 如何处理你的翻译。
扫描
查找 locale 目录中的所有 .po 文件
对比
识别 msgstr 值为空的条目
翻译
将批量内容发送给你选择的 AI 模型
写入
用翻译更新你的 .po 文件
占位符保护
Django 使用特殊占位符表示动态值。破坏这些占位符会导致应用崩溃。TranslateBot 会保持它们完整。
输入(msgid)
Welcome back, %(username)s! You have %(count)d new messages.
输出(msgstr - 法语)
Bon retour, %(username)s ! Vous avez %(count)d nouveaux messages.
%(name)s
命名字符串
%(count)d
命名整数
%s
位置字符串
{0}
格式索引
为什么需要试运行?
在进行完整翻译之前,使用 --dry-run 可准确查看将要翻译的内容——无需调用任何 API,也不会更改你的文件。
$
python manage.py translate --target-lang nl --dry-run
ℹ️ Found 3 untranslated entries
🔍 Dry run mode: skipping LLM translation
✓ Would translate 'Welcome to our platform'
✓ Would translate 'Save changes'
✓ Would translate 'Delete account'
Dry run complete: 3 entries would be translated
无 API 费用
查看需要翻译的内容
文件不会被修改