{"id":37157999,"url":"https://github.com/quailyquaily/translate-cli","last_synced_at":"2026-01-14T18:51:50.069Z","repository":{"id":281008721,"uuid":"943726129","full_name":"quailyquaily/translate-cli","owner":"quailyquaily","description":"A CLI tool that uses AI to translate JSON locale files","archived":false,"fork":false,"pushed_at":"2025-05-31T01:39:22.000Z","size":28,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T01:16:41.381Z","etag":null,"topics":["ai","cli","i18n"],"latest_commit_sha":null,"homepage":"https://quaily.com/opensource","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quailyquaily.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T06:59:54.000Z","updated_at":"2025-08-27T14:28:00.000Z","dependencies_parsed_at":"2025-03-06T14:35:17.939Z","dependency_job_id":null,"html_url":"https://github.com/quailyquaily/translate-cli","commit_stats":null,"previous_names":["quailyquaily/translate-cli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/quailyquaily/translate-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quailyquaily%2Ftranslate-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quailyquaily%2Ftranslate-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quailyquaily%2Ftranslate-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quailyquaily%2Ftranslate-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quailyquaily","download_url":"https://codeload.github.com/quailyquaily/translate-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quailyquaily%2Ftranslate-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cli","i18n"],"created_at":"2026-01-14T18:51:49.496Z","updated_at":"2026-01-14T18:51:50.059Z","avatar_url":"https://github.com/quailyquaily.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# translate-cli\n\nA command-line interface (CLI) tool that uses AI to translate locale files based on JSON format.\n\n## Features\n\n- support multiple AI providers\n- support glossary\n- support adding background information\n- batch translation\n- no \"您\" or \"您好\" or \"您的\" in Chinese\n- improved writing style in Japanese\n\n## Usage\n\n```bash\n# create empty locale files\n$ echo \"{}\" \u003e example/langs/ja.json\n$ echo \"{}\" \u003e example/langs/zh-TW.json\n\n# translate\n$ translate-cli translate -s example/langs/en-US.json -d example/langs -g example/glossary.json -b example/background.txt --batch=20\n📦 batch size: 20\n📄 source:\n  - file: example/langs/en-US.json\n  - records: 12\n📖 glossary:\n  - file: example/glossary.json\n📚 background:\n  - file: example/background.txt\n🌍 translating ...\n✅ example/langs/ja.json: 12/12\n✅ example/langs/zh-TW.json: 12/12\n```\n\nin which,\n\n- `-s`: the source locale file to be used as a reference for translation.\n- `-d`: the directory where the locale files are located.\n- `-g`: the glossary file to be used as a reference for translation.\n- `--batch`: the batch size for translation. default is 5.\n  - in batch mode, it will arrange `batch` size items into a JSON object and send it to the AI provider at once.\n  - the larger size may increase the cost of tokens, but it may also improve the translation quality as well.\n  - if the size is too large, it may cause out of context window error.\n  - some AI providers issue to handle complex JSON format, if you encounter this issue, you can try to reduce the size to 1\n\n## Install\n\nPlease check the latest release [here](https://github.com/quailyquaily/translate-cli/tags), and download the binary for your platform.\n\nExtract the binary and put it in your `$PATH` environment variable.\n\n## Install from source\n\n```bash\ngo install github.com/quailyquaily/translate-cli@latest\n```\n\n## How it works\n\n`translate-cli` reads the directory containing locale files, retrieves translations from AI, and then writes the translated content back to the same files.\n\nTo have `translate-cli` translate the content of a JSON locale file, any existing values will be ignored.\n\nIf you want `translate-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 `translate-cli` generate a new translation.\n\n## Supported AI providers\n\n- [x] OpenAI\n- [x] OpenAI compatible API (e.g. DeepSeek, Grok)\n- [ ] Azure OpenAI\n- [ ] Bedrock\n- [ ] Susano\n\n## Config\n\nthe default config file is `~/.config/translate-cli/config.yaml`.\n\nexample config file:\n\n```yaml\ndebug: false\nopenai:\n  api_key: \"sk-...\"\n  api_base: https://api.openai.com/v1\n  model: \"gpt-4o-mini\"\nprovider: openai\n```\n\nin which,\n\n- `debug`: This flag specifies whether to enable debug mode.\n- `openai`: This section specifies the OpenAI compatible API configuration.\n  - `api_key`: This flag specifies the API key for the OpenAI compatible API.\n  - `api_base`: This flag specifies the base URL for the OpenAI compatible API.\n  - `model`: This flag specifies the model to be used for the OpenAI compatible API.\n- `susano`: This section specifies the Susano API configuration.\n  - `api_key`: This flag specifies the API key for the Susano API.\n  - `api_base`: This flag specifies the endpoint for the Susano API.\n- `bedrock`: This section specifies the Bedrock API configuration.\n  - `key`: This flag specifies the key for the Bedrock API.\n  - `secret`: This flag specifies the secret for the Bedrock API.\n  - `model`: This flag specifies the ARN of the model to be used for the Bedrock API.\n- `azure`: This section specifies the Azure OpenAI API configuration.\n  - `api_key`: This flag specifies the API key for the Azure OpenAI API.\n  - `endpoint`: This flag specifies the endpoint for the Azure OpenAI API.\n  - `model`: This flag specifies the model to be used for the Azure OpenAI API.\n- `provider`: This flag specifies the AI provider. possible values are:\n  - `openai`: use openai compacible API\n  - `susano`: use susano api\n  - `bedrock`: use bedrock api\n  - `azure`: use azure openai api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquailyquaily%2Ftranslate-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquailyquaily%2Ftranslate-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquailyquaily%2Ftranslate-cli/lists"}