V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
lyric
V2EX  ›  分享创造

做了个批量翻译 JSON locale files 的工具

  •  
  •   lyric ·
    lyricat · 19 天前 · 1320 次点击

    代码: https://github.com/quailyquaily/translate-cli

    特点

    • 支持 glossary 和背景信息
    • 对日语做了特别优化
    • 不在翻译中使用“您”字
    • 支持嵌套 JSON
    • 支持批量翻译
    • 支持各类 AI 服务商( Deepseek ,claude ai 啥的)

    运行

    $ translate-cli translate -s example/langs/en-US.json -d example/langs -g example/glossary.json -b example/background.txt --batch=20
    
    📦 batch size: 20
    📄 source:
      - file: example/langs/en-US.json
      - records: 12
    📖 glossary:
      - file: example/glossary.json
    📚 background:
      - file: example/background.txt
    🌍 translating ...
    ✅ example/langs/ja.json: 12/12
    ✅ example/langs/zh-TW.json: 12/12
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5220 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 07:40 · PVG 15:40 · LAX 00:40 · JFK 03:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.