{"id":17646370,"url":"https://github.com/ryanhex53/gpt-po","last_synced_at":"2025-03-10T18:31:26.073Z","repository":{"id":160774269,"uuid":"635593733","full_name":"ryanhex53/gpt-po","owner":"ryanhex53","description":"command tool for translate po files by using openai api","archived":false,"fork":false,"pushed_at":"2025-02-01T14:57:03.000Z","size":227,"stargazers_count":77,"open_issues_count":2,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T09:16:10.295Z","etag":null,"topics":["chatgpt","gettext","openai","translation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ryanhex53.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"buy_me_a_coffee":"ryanhex"}},"created_at":"2023-05-03T03:07:44.000Z","updated_at":"2025-02-11T17:08:00.000Z","dependencies_parsed_at":"2024-04-09T13:57:01.447Z","dependency_job_id":"7abc14f5-bcdf-4046-b9aa-bd1c077ecf34","html_url":"https://github.com/ryanhex53/gpt-po","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhex53%2Fgpt-po","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhex53%2Fgpt-po/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhex53%2Fgpt-po/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhex53%2Fgpt-po/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanhex53","download_url":"https://codeload.github.com/ryanhex53/gpt-po/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242902604,"owners_count":20204128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chatgpt","gettext","openai","translation"],"created_at":"2024-10-23T11:01:31.019Z","updated_at":"2025-03-10T18:31:26.065Z","avatar_url":"https://github.com/ryanhex53.png","language":"TypeScript","funding_links":["https://buymeacoffee.com/ryanhex"],"categories":["TypeScript"],"sub_categories":[],"readme":"# PO File Translation Tool for ChatGPT\n\n[![NPM version](https://img.shields.io/npm/v/gpt-po.svg)](https://npmjs.org/package/gpt-po)\n[![Downloads](https://img.shields.io/npm/dm/gpt-po.svg)](https://npmjs.org/package/gpt-po)\n\nTranslation tool for gettext (po) files that supports custom system prompts and user dictionaries. It also supports translating specified po files to a designated target language and updating po files based on pot files.\n\nRead in other languages: English | [简体中文](./README_zh-CN.md)\n\n\u003ca href=\"https://buymeacoffee.com/ryanhex\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-red.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n## Installation\n\n```\nnpm install gpt-po\n```\n\nSet `OPENAI_API_KEY` before using this tool.\n\n**It is recommended to use the paid OpenAI API to improve translation speed, as the free OpenAI API is slower (only 3 translations per minute) and has usage restrictions.**\n\n## Usage Scenarios\n\n- `gpt-po sync --po \u003cfile\u003e --pot \u003cfile\u003e` Update the po file based on the pot file, while preserving the original translations.\n- `gpt-po --po \u003cfile\u003e` Translate specified po files to a designated target language.\n- `gpt-po --po \u003cfile\u003e --lang \u003clang\u003e` Translate specified po files to a designated target language (overriding language specified in po file).\n- `gpt-po --dir .` Translate all po files in current directory to a designated target language.\n- `gpt-po userdict` Modify or view user dictionaries\n- `gpt-po userdict --explore` Explore user dictionaries, if you want add new dictionaries or modify existing dictionaries. dictionaries can be named as `dictionary-\u003clang\u003e.json`, for example, `dictionary-zh.json` is the dictionary for Simplified Chinese.\n\n```\nUsage: gpt-po [options] [command]\n\ncommand tool for translate po files by gpt\n\nOptions:\n  -V, --version           output the version number\n  -h, --help              display help for command\n\nCommands:\n  translate [options]     translate po file (default command)\n  sync [options]          update po from pot file\n  userdict [options]      open/edit user dictionary\n  remove [options]        remove po entries by options\n  help [command]          display help for command\n```\n\n```\nUsage: gpt-po [options]\n\ntranslate po file (default command)\n\nOptions:\n  -k, --key \u003ckey\u003e        openai api key (env: OPENAI_API_KEY)\n  --host \u003chost\u003e          openai api host (env: OPENAI_API_HOST)\n  --model \u003cmodel\u003e        openai model (default: \"gpt-4o-mini\", env: OPENAI_MODEL)\n  --po \u003cfile\u003e            po file path\n  --dir \u003cdir\u003e            po file directory\n  -src, --source \u003clang\u003e  source language (default: \"english\")\n  --verbose              show verbose log\n  -l, --lang \u003clang\u003e      target language (ISO 639-1 code)\n  -o, --output \u003cfile\u003e    output file path, overwirte po file by default\n  --context \u003cfile\u003e       context file path (provides additional context to the bot)\n  --context-length \u003clength\u003e  Maximum accumulated length of source strings (msgid) to translate in each API request (default: 2000, env: API_CONTEXT_LENGTH)\n  --timeout \u003cms\u003e         Timeout in milliseconds for API requests (default: 20000, env: API_TIMEOUT)\n  -h, --help             display help for command\n```\n\n```\nUsage: gpt-po remove [options]\n\nremove po entries by options\n\nOptions:\n  --po \u003cfile\u003e                       po file path\n  --fuzzy                           remove fuzzy entries\n  -obs, --obsolete                  remove obsolete entries\n  -ut, --untranslated               remove untranslated entries\n  -t, --translated                  remove translated entries\n  -tnf, --translated-not-fuzzy      remove translated not fuzzy entries\n  -ft, --fuzzy-translated           remove fuzzy translated entries\n  -rc, --reference-contains \u003ctext\u003e  remove entries whose reference contains text, text can be a regular expression like /text/ig\n  -h, --help                        display help for command\n```\n\n```\nUsage: gpt-po sync [options]\n\nupdate po from pot file\n\nOptions:\n  --po \u003cfile\u003e   po file path\n  --pot \u003cfile\u003e  pot file path\n  -h, --help    display help for command\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhex53%2Fgpt-po","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanhex53%2Fgpt-po","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhex53%2Fgpt-po/lists"}