{"id":13911113,"url":"https://github.com/Quilljou/transmart","last_synced_at":"2025-07-18T10:32:22.474Z","repository":{"id":143500479,"uuid":"612909526","full_name":"Quilljou/transmart","owner":"Quilljou","description":"Automate your i18n localization with AI","archived":false,"fork":false,"pushed_at":"2025-07-14T15:55:23.000Z","size":1644,"stargazers_count":158,"open_issues_count":5,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T19:58:29.931Z","etag":null,"topics":["chatgpt","i18n","nodejs","openai","translater","translation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quilljou.png","metadata":{"files":{"readme":"README-zh_CN.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-03-12T10:55:32.000Z","updated_at":"2025-07-14T15:55:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebc2d6bb-28c2-49f5-9adb-cdf78e432126","html_url":"https://github.com/Quilljou/transmart","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/Quilljou/transmart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quilljou%2Ftransmart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quilljou%2Ftransmart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quilljou%2Ftransmart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quilljou%2Ftransmart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quilljou","download_url":"https://codeload.github.com/Quilljou/transmart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quilljou%2Ftransmart/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265742420,"owners_count":23820837,"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","i18n","nodejs","openai","translater","translation"],"created_at":"2024-08-07T00:01:58.091Z","updated_at":"2025-07-18T10:32:21.932Z","avatar_url":"https://github.com/Quilljou.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/logo.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cb\u003e Transmart - 利用 AI 自动化您的 i18n\u003c/b\u003e\n\u003c/p\u003e\n\n简体中文 | [English](./README.md)\n\n\n![alt](./assets/record.gif)\n\n![npm](https://img.shields.io/npm/v/@transmart/cli?style=flat-square)\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/p/sandbox/v12-12v2h6?file=%2FREADME.md)\n\nTransmart 是一个开源的开发者工具，利用 ChatGPT 实现 i18n 翻译自动化。给定一个基础语言并指定需要输出的所有语言，运行它将生成所有 i18n 区域设置文件。\n\n它由两部分组成：Cli 和 Core。Core 是 Transmart 的 NodeJS 核心实现，而 Cli 是封装了 Core 的命令行工具。在大多数情况下，只使用 Cli 就足够了。\n\n该项目目前正在积极开发中，欢迎 PR，也可以在[Twitter](https://twitter.com/quillzhou)上联系我\n\n## 特征\n\n- [x] 支持大型文件,不必担心 4096 个标记限制\n- [x] 支持使用[Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames)显示的所有语言，以及可以通过 ChatGPT 处理的所有语言。\n- [x] 支持覆盖 AI 翻译值\n- [x] 支持[i18next](https://www.i18next.com/)\n- [ ] 支持[vue-i18n](https://kazupon.github.io/vue-i18n/)\n- [x] 支持[Chrome.i18n](https://developer.chrome.com/docs/webstore/i18n/#choosing-locales-to-support)\n- [x] 支持 Glob 名称空间匹配\n- [x] 支持自定义 OpenAI 模型、API 端点\n- [ ] 支持自定义区域设置文件结构\n- [ ] 支持 iOS\n- [ ] 支持 Android\n\n## 设置\n\n\u003e Transmart 要求 Node 版本 13 或更高。\n\n### 1. 安装\n\n要安装 Transmart，请运行：\n\n````sh\nnpm install @transmart/cli -D\n\n# or\n\nyarn add @transmart/cli\n\n\n### 2. 项目配置\n首先，在项目根目录中创建一个transmart.config.js文件，或任何其他文件格式 `cosmiconfig` 可以搜索到的\n\ntransmart.config.js\n\n```js\nmodule.exports = {\n  baseLocale: 'en',\n  locales: ['fr', 'jp', 'de'],\n  localePath: 'public/locales',\n  openAIApiKey: 'your-own-openai-api-key',\n  overrides: {\n    'zh-CN': {\n      common: {\n        create_app: 'Create my Application',\n      },\n    },\n  },\n}\n````\n\n所有选项可 [参考](#选项)\n\n### 3. 翻译。\n\n向您的 npm 脚本添加 transmart 命 令\n\n```json\n{\n  \"translate\": \"transmart\"\n}\n```\n\n然后执行\n\n```sh\nnpm run translate\n\n```\n\n或者您可以在命令行中直接使用 npx 前缀执行\n\n```sh\nnpx transmart\n```\n\n如果对 AI 翻译的结果不满意，请使用 [overrides](#选项) 选项部分覆盖生成的 JSON\n\n享受 i18n 吧 🎉🎉\n\n## 选项\n\n| 名称             | 类型                                                  | 描述                                                                           | 是否必须 |\n| ---------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------ | :------: |\n| baseLocale       | string                                                | Transmart 将用作翻译参考的语言。                                               |    是    |\n| locales          | string[]                                              | 所有需要翻译的语言                                                             |    是    |\n| localePath       | string                                                | 存储国际化文件的位置                                                           |    是    |\n| openAIApiKey     | string                                                | OpenAI API 密钥                                                                |    是    |\n| context     | string                                | 提供一些上下文让翻译更准确                                                                             |   否    |\n| openAIApiModel   | string                                                | OpenAI API 模型，默认为“gpt-3.5-turbo-16k-0613”                                         |    否    |\n| overrides        | `Record\u003cstring, Record\u003cstring, Record\u003cstring, any\u003e\u003e\u003e` | 如果你不满意 AI 翻译结果，用于部分覆盖生成的 JSON (locale-namespace-key:value) |    否    |\n| namespaceGlob    | string\\|string[]                                      | 命名空间匹配项                                                                 |    否    |\n| openAIApiUrl     | string                                                | 可选基本 OpenAI API url 地址，在使用代理时很有用                               |    否    |\n| openAIApiUrlPath | string                                                | 可选的 OpenAI API url 地址， 在使用代理时很有用                                |    否    |\n|                  |\n\n## 贡献\n\n要贡献到 Transmart，请参阅[contributing.md](./CONTRIBUTING.md)\n\n## 受以下启发\n\n- https://chatgpt-i18n.vercel.app/\n- https://twitter.com/forgebitz/status/1634100746617597955\n- https://github.com/yetone/openai-translator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuilljou%2Ftransmart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQuilljou%2Ftransmart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuilljou%2Ftransmart/lists"}