百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
I

i18n-cli

> AI 编程
开源

一个 CLI 工具,它利用 OpenAI API 来翻译基于 JSON 的本地化文件

196 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个 CLI 工具,它利用 OpenAI API 来翻译基于 JSON 的本地化文件

NOTICE:

This project is no longer being developed, and will not be continued further.

Please move to translate-cli for better alternative.


i18n-cli

A command-line interface (CLI) tool that utilizes the OpenAI API to translate locale files based on JSON format.

Install

bash
go install github.com/pandodao/i18n-cli@latest

Usage

bash
export OPENAI_API_KEY=YOUR_API_KEY
i18n-cli translate \
  --dir ./locales \
  --source ./locales/en-US.json \
  --independent ./independent.json

in which,

  • --dir: This flag specifies the directory where the locale files are located. The value ./locales specifies that the locales directory is located in the current working directory.
  • --source: This flag specifies the source locale file to be used as a reference for translation.
  • --independent: This flag specifies the independent locale file to be used as a reference for translation.

i18n-cli reads the directory containing locale files, retrieves translations from OpenAI, and then writes the translated content back to the same files.

To have i18n-cli translate the content of a JSON locale file, any existing values will be ignored.

If you want i18n-cli to translate a specific value, you can add a "!" at the beginning of the string. Alternatively, you can delete the key/value pair from the JSON file to have i18n-cli generate a new translation.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goi18nopenai

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.