{"_id":"@arietta-studio/arietta-i18n","_rev":"2-cccb9a32be4076117e0d41a8d958dd4c","name":"@arietta-studio/arietta-i18n","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"@arietta-studio/arietta-i18n","version":"1.0.1","description":"Arietta i18n is a CLI tool that automate translate your i18n localization with AI","keywords":["ai","i18n","openai","gpt","langchain"],"homepage":"https://github.com/arietta-studio/arietta-tools/tree/master/packages/arietta-i18n","bugs":{"url":"https://github.com/arietta-studio/arietta-tools/issues/new"},"repository":{"type":"git","url":"git+https://github.com/arietta-studio/arietta-tools.git"},"license":"MIT","author":{"name":"Arietta Studio","email":"info@arietta-studio.ai"},"sideEffects":false,"type":"module","imports":{"@":"./src"},"exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","bin":{"arietta-i18n":"dist/cli.js"},"scripts":{"build":"bun run type-check && pkgroll --minify -p tsconfig.prod.json --env.NODE_ENV=production && bun run shebang","dev":"pkgroll -p tsconfig.prod.json --env.NODE_ENV=development --watch","link":"bun run build && bun link -f","shebang":"arietta-shebang -t ./dist/cli.js","start":"node ./dist/cli.js","test":"vitest --passWithNoTests","test:coverage":"vitest run --coverage --passWithNoTests","type-check":"tsc --noEmit"},"dependencies":{"@arietta-studio/arietta-cli-ui":"latest","@inkjs/ui":"^1","@langchain/core":"latest","@langchain/openai":"latest","chalk":"^5","commander":"^11","conf":"^12","consola":"^3","cosmiconfig":"^9","dotenv":"^16","fast-deep-equal":"^3","glob":"^10","gpt-tokenizer":"^2","ink":"^4.2","json-stable-stringify":"^1","just-diff":"^6","langchain":"latest","lodash-es":"^4","p-map":"^7","pangu":"^4","react":"^18","remark-frontmatter":"^4","remark-gfm":"^3","remark-parse":"^10","remark-stringify":"^10","swr":"^2","unified":"^11","unist-util-visit":"^5","update-notifier":"^7","zustand":"^4"},"devDependencies":{"@types/json-stable-stringify":"^1"},"peerDependencies":{"ink":">=4","react":">=18"},"engines":{"node":">=18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"a2ba72b9014803e1a1947395bb35109544a79f44","_id":"@arietta-studio/arietta-i18n@1.0.1","_nodeVersion":"20.2.0","_npmVersion":"lerna/8.1.2/node@v20.2.0+arm64 (darwin)","dist":{"integrity":"sha512-+m3xCDR+99O+NJgTKRjG5kekHAVjJK/aANfDKWo+4Pc7gLy5tz2fhzH/P0EUnEjsMzUrjBNm1JvL37/E8wfH3Q==","shasum":"236e641b38b219f075f177eb659418b86acfbeb5","tarball":"https://registry.npmjs.org/@arietta-studio/arietta-i18n/-/arietta-i18n-1.0.1.tgz","fileCount":12,"unpackedSize":126362,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA73c87diS2FaMJoJCYZFyd69NZlo/UgQVG1laWfL8BnAiB0Og3UskqOZbvKsFk3VpMphGFTUFnDdlrmYbIljdmpvg=="}]},"_npmUser":{"name":"gince","email":"ruzauskas.gintaras@gmail.com"},"directories":{},"maintainers":[{"name":"gince","email":"ruzauskas.gintaras@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/arietta-i18n_1.0.1_1711281782813_0.8266450065805919"},"_hasShrinkwrap":false},"1.0.2":{"name":"@arietta-studio/arietta-i18n","version":"1.0.2","description":"Arietta i18n is a CLI tool that automate translate your i18n localization with AI","keywords":["ai","i18n","openai","gpt","langchain"],"homepage":"https://github.com/arietta-studio/arietta-tools/tree/master/packages/arietta-i18n","bugs":{"url":"https://github.com/arietta-studio/arietta-tools/issues/new"},"repository":{"type":"git","url":"git+https://github.com/arietta-studio/arietta-tools.git"},"license":"MIT","author":{"name":"Arietta Studio","email":"info@arietta-studio.ai"},"sideEffects":false,"type":"module","imports":{"@":"./src"},"exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","bin":{"arietta-i18n":"dist/cli.js"},"scripts":{"build":"npm run type-check && pkgroll --minify -p tsconfig.prod.json --env.NODE_ENV=production && npm run shebang","dev":"pkgroll -p tsconfig.prod.json --env.NODE_ENV=development --watch","link":"npm run build && npm link -f","shebang":"arietta-shebang -t ./dist/cli.js","start":"node ./dist/cli.js","test":"vitest --passWithNoTests","test:coverage":"vitest run --coverage --passWithNoTests","type-check":"tsc --noEmit"},"dependencies":{"@arietta-studio/arietta-cli-ui":"1.0.2","@inkjs/ui":"^1","@langchain/core":"latest","@langchain/openai":"latest","chalk":"^5","commander":"^11","conf":"^12","consola":"^3","cosmiconfig":"^9","dotenv":"^16","fast-deep-equal":"^3","glob":"^10","gpt-tokenizer":"^2","ink":"^4.2","json-stable-stringify":"^1","just-diff":"^6","langchain":"latest","lodash-es":"^4","p-map":"^7","pangu":"^4","react":"^18","remark-frontmatter":"^4","remark-gfm":"^3","remark-parse":"^10","remark-stringify":"^10","swr":"^2","unified":"^11","unist-util-visit":"^5","update-notifier":"^7","zustand":"^4"},"devDependencies":{"@types/json-stable-stringify":"^1"},"peerDependencies":{"ink":">=4","react":">=18"},"engines":{"node":">=18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@arietta-studio/arietta-i18n@1.0.2","gitHead":"f7016316d29176c321858560ab45d843c8a6cfd6","_nodeVersion":"18.19.1","_npmVersion":"9.9.3","dist":{"integrity":"sha512-rSOKMkBSzlSHGp15VfMF1LrTBNA/vSFWZgPXaoszeRJbl+QblSGqlRhMZae3dSxVP5WVz90lQ3G6bAXnhiqw3w==","shasum":"ecfd4f50e7217c500ab31af8e1325bb77482b4b3","tarball":"https://registry.npmjs.org/@arietta-studio/arietta-i18n/-/arietta-i18n-1.0.2.tgz","fileCount":10,"unpackedSize":89122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD00BXQIsHlAgBP+369r7Q5NFfx+M85w0XlETxYKGxogAIgSZvR1ro4e2F4EjNam4zi42pGxXYvohlLbZSVJfrNIhE="}]},"_npmUser":{"name":"gince","email":"ruzauskas.gintaras@gmail.com"},"directories":{},"maintainers":[{"name":"gince","email":"ruzauskas.gintaras@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/arietta-i18n_1.0.2_1711285016500_0.9093324117027655"},"_hasShrinkwrap":false},"1.0.3":{"name":"@arietta-studio/arietta-i18n","version":"1.0.3","description":"Arietta i18n is a CLI tool that automate translate your i18n localization with AI","keywords":["ai","i18n","openai","gpt","langchain"],"homepage":"https://github.com/arietta-studio/arietta-tools/tree/master/packages/arietta-i18n","bugs":{"url":"https://github.com/arietta-studio/arietta-tools/issues/new"},"repository":{"type":"git","url":"git+https://github.com/arietta-studio/arietta-tools.git"},"license":"MIT","author":{"name":"Arietta Studio","email":"info@arietta-studio.ai"},"sideEffects":false,"type":"module","imports":{"@":"./src"},"exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","bin":{"arietta-i18n":"dist/cli.js"},"scripts":{"build":"bun run type-check && pkgroll --minify -p tsconfig.prod.json --env.NODE_ENV=production && bun run shebang","dev":"pkgroll -p tsconfig.prod.json --env.NODE_ENV=development --watch","link":"bun run build && bun link -f","shebang":"arietta-shebang -t ./dist/cli.js","start":"node ./dist/cli.js","test":"vitest --passWithNoTests","test:coverage":"vitest run --coverage --passWithNoTests","type-check":"tsc --noEmit"},"dependencies":{"@arietta-studio/arietta-cli-ui":"1.0.3","@inkjs/ui":"^1","@langchain/core":"latest","@langchain/openai":"latest","chalk":"^5","commander":"^11","conf":"^12","consola":"^3","cosmiconfig":"^9","dotenv":"^16","fast-deep-equal":"^3","glob":"^10","gpt-tokenizer":"^2","ink":"^4.2","json-stable-stringify":"^1","just-diff":"^6","langchain":"latest","lodash-es":"^4","p-map":"^7","pangu":"^4","react":"^18","remark-frontmatter":"^4","remark-gfm":"^3","remark-parse":"^10","remark-stringify":"^10","swr":"^2","unified":"^11","unist-util-visit":"^5","update-notifier":"^7","zustand":"^4"},"devDependencies":{"@types/json-stable-stringify":"^1"},"peerDependencies":{"ink":">=4","react":">=18"},"engines":{"node":">=18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@arietta-studio/arietta-i18n@1.0.3","gitHead":"4098f132178c30a2028776892f87d7f27196e836","_nodeVersion":"18.19.1","_npmVersion":"9.9.3","dist":{"integrity":"sha512-cT23czcnfm3ifNcDKz7WIOwoauRVUMQglsIvbmSALi+JOa2oAHa6lTmDufu2feuTq/6cKU9EWwsBWv6pMZb+xQ==","shasum":"871bb113ee27569325e8c7a6f6bdeda2f06a407d","tarball":"https://registry.npmjs.org/@arietta-studio/arietta-i18n/-/arietta-i18n-1.0.3.tgz","fileCount":10,"unpackedSize":89119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESaDoh7ZLvPEKcKX0nX28T2yKTv2j/zeKH3IgLxKNhzAiEAlJcx1Osla4DgYERsK6Gk6QO60O1AnsQhsLiEJ7Xq1+0="}]},"_npmUser":{"name":"gince","email":"ruzauskas.gintaras@gmail.com"},"directories":{},"maintainers":[{"name":"gince","email":"ruzauskas.gintaras@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/arietta-i18n_1.0.3_1711286852159_0.6651058262762231"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-24T12:03:02.700Z","1.0.1":"2024-03-24T12:03:03.030Z","modified":"2024-03-24T13:27:32.981Z","1.0.2":"2024-03-24T12:56:56.674Z","1.0.3":"2024-03-24T13:27:32.304Z"},"maintainers":[{"name":"gince","email":"ruzauskas.gintaras@gmail.com"}],"description":"Arietta i18n is a CLI tool that automate translate your i18n localization with AI","homepage":"https://github.com/arietta-studio/arietta-tools/tree/master/packages/arietta-i18n","keywords":["ai","i18n","openai","gpt","langchain"],"repository":{"type":"git","url":"git+https://github.com/arietta-studio/arietta-tools.git"},"author":{"name":"Arietta Studio","email":"info@arietta-studio.ai"},"bugs":{"url":"https://github.com/arietta-studio/arietta-tools/issues/new"},"license":"MIT","readme":"<div align=\"center\"><a name=\"readme-top\"></a>\n\n<img height=\"120\" src=\"https://unpkg.com/@arietta-studio/assets-logo@latest/assets/logo-3d.webp\" style=\"vertical-align: middle;\">\n<img height=\"120\" src=\"https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg\" style=\"vertical-align: middle;\">\n<img height=\"120\" src=\"https://unpkg.com/@arietta-studio/assets-emoji@latest/assets/globe-showing-europe-africa.webp\" style=\"vertical-align: middle;\">\n\n<h1>Arietta i18n</h1>\n\nArietta i18n is a CLI workflow tool that uses ChatGPT for automated i18n.\n\n[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url]\n\n<!-- SHIELD GROUP -->\n\n[![][npm-release-shield]][npm-release-link]\n[![][github-releasedate-shield]][github-releasedate-link]\n[![][github-action-test-shield]][github-action-test-link]\n[![][github-action-release-shield]][github-action-release-link]<br/>\n[![][github-contributors-shield]][github-contributors-link]\n[![][github-forks-shield]][github-forks-link]\n[![][github-stars-shield]][github-stars-link]\n[![][github-issues-shield]][github-issues-link]\n[![][github-license-shield]][github-license-link]\n\n![](https://gw.alipayobjects.com/zos/kitchen/AH7rvv06qn/preview-i18n.webp)\n\n</div>\n\n<details>\n<summary><kbd>Table of Contents</kbd></summary>\n\n#### TOC\n\n- [✨ Features](#-features)\n- [📦 Installation](#-installation)\n- [🤯 Usage](#-usage)\n  - [Configuration](#configuration)\n  - [Environment Variable](#environment-variable)\n- [🌏 Locale Configuration](#-locale-configuration)\n  - [File Structure Selection](#file-structure-selection)\n  - [Running](#running)\n- [📝 Markdown Configuration](#-markdown-configuration)\n  - [File Structure](#file-structure)\n  - [Running](#running-1)\n- [⌨️ Local Development](#️-local-development)\n- [🤝 Contributing](#-contributing)\n- [Credits](#credits)\n\n####\n\n</details>\n\n## ✨ Features\n\n- [x] 🤖 Utilize ChatGPT for automated i18n translation\n- [x] ✂️ Support automatic splitting of large files without worrying about ChatGPT token limits.\n- [x] ♻️ Support incremental i18n updates, automatically extract new content based on `entry` files.\n- [x] 🗂️ Support single file mode `en_US.json` and folder mode `en_US/common.json` to work perfectly with `i18next`.\n- [x] 🌲 Support `flat` and `tree` structure for locale files.\n- [x] 🛠️ Support customizing OpenAI models, API proxies, and temperature.\n- [x] 📝 Support automated i18n translation of `Markdown` files.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 📦 Installation\n\nTo install Arietta i18n, run the following command:\n\n```bash\nnpm install -g @arietta-studio/arietta-i18n\n```\n\n> \\[!IMPORTANT]\\\n> Please make sure you have `Node.js` version **>= 18**.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🤯 Usage\n\nTo initialize the Arietta i18n configuration, run the following command:\n\n```shell\n$ arietta-i18n -o # or use the full flag --option\n```\n\n> \\[!IMPORTANT]\\\n> To use AI auto-generation, you need to fill in the [OpenAI Token](https://platform.openai.com/account/api-keys) in the settings.\n\n```shell\n# Translate Locale files\n$ arietta-i18n # or $ arietta-i18n locale\n\n# Translate Markdown files\n$ arietta-i18n md\n\n# Run i18n translation and markdown translation simultaneously\n$ arietta-i18n --with-md\n\n# Specify the configuration file\n$ arietta-i18n -c './custom-config.js' # or use the full flag --config\n```\n\n<br/>\n\n### Configuration\n\nYou can choose any configuration method in [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig) format\n\n- `i18n` property in `package.json`\n- `.i18nrc` file in JSON or YAML format\n- `.i18nrc.json`, `.i18nrc.yaml`, `.i18nrc.yml`, `.i18nrc.js`, `.i18nrc.cjs`\n- `defineConfig` provides a secure definition method that can be imported from `@arietta-studio/arietta-i18n`\n\n> \\[!TIP]\n>\n> This project provides a secure definition method `defineConfig` that can be imported from `@arietta-studio/arietta-i18n`\n\n<br/>\n\n### Environment Variable\n\nThis project provides some additional configuration items set with environment variables:\n\n| Environment Variable | Required | Description                                                                                                                                   | Example                                                                                   |\n| -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| `OPENAI_API_KEY`     | Yes      | This is the API key you apply on the OpenAI account page                                                                                      | `sk-xxxxxx...xxxxxx`                                                                      |\n| `OPENAI_PROXY_URL`   | No       | If you manually configure the OpenAI interface proxy, you can use this configuration item to override the default OpenAI API request base URL | `https://api.chatanywhere.cn/v1`<br/>The default value is<br/>`https://api.openai.com/v1` |\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🌏 Locale Configuration\n\n| Property Name | Required | Type           | Default Value   | Description                                                                  |\n| ------------- | -------- | -------------- | --------------- | ---------------------------------------------------------------------------- |\n| entry         | `*`      | `string`       | -               | Entry file or folder                                                         |\n| entryLocale   | `*`      | `string`       | -               | Language to use as translation reference                                     |\n| modelName     |          | `string`       | `gpt-3.5-turbo` | Model to use                                                                 |\n| output        | `*`      | `string`       | -               | Location to store localized files                                            |\n| outputLocales | `*`      | `string[]  `   | `[]`            | All the languages to be translated                                           |\n| reference     |          | `string`       | -               | Provide some context for more accurate translations                          |\n| splitToken    |          | `number`       | -               | Split the localized JSON file by tokens, automatically calculated by default |\n| temperature   |          | `number`       | `0`             | Sampling temperature to use                                                  |\n| concurrency   |          | `number`       | `5`             | Number of concurrently pending promises returned                             |\n| experimental  |          | `experimental` | `{}`            | Experimental features, see below                                             |\n| markdown      |          | `markdown`     | `{}`            | See `markdown` configuration below                                           |\n\n#### `experimental`\n\n| Property Name | Required | Type      | Default Value | Description                                                                                   |\n| ------------- | -------- | --------- | ------------- | --------------------------------------------------------------------------------------------- |\n| jsonMode      |          | `boolean` | `false`       | Enable gpt force JSON output for stability (only supported by new models after November 2023) |\n\n<br/>\n\n#### Example 1 `.i18nrc.js`\n\n```js\nconst { defineConfig } = require('@arietta-studio/arietta-i18n');\n\nmodule.exports = defineConfig({\n  entry: 'locales/en_US.json',\n  entryLocale: 'en_US',\n  output: 'locales',\n  outputLocales: ['lt_LT'],\n});\n```\n\n#### Example 2 `.i18nrc.json`\n\n```json\n{\n  \"entry\": \"locales/en_US.json\",\n  \"entryLocale\": \"en_US\",\n  \"output\": \"locales\",\n  \"outputLocales\": [\"lt_LT\"]\n}\n```\n\n#### Example 3 `package.json`\n\n```json\n{\n  \"...\": \"...\",\n  \"i18n\": {\n    \"entry\": \"locales/en_US.json\",\n    \"entryLocale\": \"en_US\",\n    \"output\": \"locales\",\n    \"outputLocales\": [\"lt_LT\"]\n  }\n}\n```\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n### File Structure Selection\n\nThere are two types of file structures supported: `flat` and `tree`.\n\n#### Flat Structure\n\nA flat structure means that all translations for different languages are stored in a single file, as shown below:\n\n```\n- locales\n  - en_US.json\n  - lt_LT.json\n  - ...\n```\n\n> \\[!TIP]\n>\n> The `flat structure` requires configuring the `entry` property in the configuration file to the corresponding JSON file [Example](./examples/locale/flat/.i18nrc.cjs)\n\n```json\n{\n  \"entry\": \"locales/en.json\",\n  \"entryLocale\": \"en_US\",\n  \"output\": \"locales\",\n  \"outputLocales\": [\"lt_LT\"]\n}\n```\n\n#### Tree Structure\n\nA tree structure means that the translations for each language are stored in separate language folders, as shown below:\n\n```\n- locales\n  - en_US\n    - common.json\n    - header.json\n    - subfolder\n      - ...\n  - lt_LT\n    - common.json\n    - header.json\n    - subfolder\n      - ...\n```\n\n> \\[!TIP]\n>\n> The `tree structure` requires configuring the `entry` property in the configuration file to the corresponding folder [Example](./examples/locale/tree/.i18nrc.cjs)\n\n```json\n{\n  \"entry\": \"locales/en_US\",\n  \"entryLocale\": \"en_US\",\n  \"output\": \"locales\",\n  \"outputLocales\": [\"lt_LT\"]\n}\n```\n\n### Running\n\nUse the `arietta-i18n` command to generate i18n files automatically:\n\n```shell\n$ arietta-i18n\n```\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 📝 Markdown Configuration\n\n| Property Name    | Required | Type                        | Default                      | Description                                                             |\n| ---------------- | -------- | --------------------------- | ---------------------------- | ----------------------------------------------------------------------- |\n| entry            | `*`      | `string[]`                  | `[]`                         | Entry file or folder, supports `glob`                                   |\n| entryLocale      |          | `string`                    | _Inherit parent locale_      | Reference language for translation                                      |\n| entryExtension   |          | `string`                    | `.md`                        | Entry file extension                                                    |\n| exclude          |          | `string[]`                  | `[]`                         | Files to be filtered, supports `glob`                                   |\n| outputLocales    |          | `string[]`                  | _Inherit parent locale_      | All languages to be translated                                          |\n| outputExtensions |          | `function`                  | `(locale) => '.{locale}.md'` | Output file extension generation                                        |\n| mode             |          | `string`,`mdast`,`function` | `string`                     | Translation mode selection, explained below                             |\n| translateCode    |          | `boolean`                   | `false`                      | Whether to translate code blocks under `mdast`, other modes are invalid |\n\n#### `outputExtensions`\n\nBy default, the translated file names are generated as `.{locale}.md`. You can customize the output file extensions with `outputExtensions`.\n\n> \\[!NOTE]\n>\n> In the example below, the entry file extension is `.md`, but we want the output file extension for the `lt-LT` translation to be `.md`, while other languages keep the default extensions.\n\n```js\nmodule.exports = {\n  markdown: {\n    entry: ['./README.md', './docs/**/*.md'],\n    entryLocale: 'en-US',\n    entryExtension: '.md',\n    outputLocales: ['lt-LT'],\n    outputExtensions: (locale, { getDefaultExtension }) => {\n      if (locale === 'en-US') return '.md';\n      return getDefaultExtension(locale);\n    },\n  },\n};\n```\n\n> `outputExtensions` supports the following `props`:\n\n```ts\ninterface OutputExtensionsProps {\n  /**\n   * @description The locale of the translated file to output\n   */\n  locale: string;\n  config: {\n    /**\n     * @description The content of the translated file to input\n     */\n    fileContent: string;\n    /**\n     * @description The path of the translated file to input\n     */\n    filePath: string;\n    /**\n     * @description The default method for generating extensions\n     */\n    getDefaultExtension: (locale: string) => string;\n  };\n}\n```\n\n#### `mode`\n\n`mode` is used to specify the translation mode, which supports two modes and custom generation modes.\n\n- `string` - Translates the complete `markdown` content.\n- `mdast` - Parses the text with `mdast` structure and translates the `text value` content. To translate code blocks, you need to enable `translateCode`.\n\n> \\[!WARNING]\n>\n> In `mdast` mode, the content to be translated will be reduced to a minimum, removing most markdown syntax structures and links.\n> This mode can greatly reduce token consumption, but it may result in inaccurate translation results.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n### File Structure\n\nThe translated files will be generated in the same directory as the entry file, with the corresponding language suffix added to the extension:\n\n```\n- README.md\n- README.lt-LT.md\n\t- docs\n\t\t- usage.md\n\t\t- usage.lt-LT.md\n\t\t- subfolder\n            - ...\n```\n\n> \\[!TIP]\n>\n> [Example](./examples/markdown/.i18nrc.cjs)\n\n### Running\n\nUse the `arietta-i18n md` command to automate the generation of i18n files:\n\n```shell\n$ arietta-i18n md\n```\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## ⌨️ Local Development\n\nYou can use Github Codespaces for online development:\n\n[![][github-codespace-shield]][github-codespace-link]\n\nAlternatively, you can clone the repository and run the following command for local development:\n\n[![][bun-shield]][bun-link]\n\n```bash\n$ git clone https://github.com/arietta-studio/arietta-tools.git\n$ cd arietta-tools\n$ bun install\n$ cd packages/arietta-i18n\n$ bun dev\n```\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🤝 Contributing\n\nWe welcome contributions in all forms. If you're interested in contributing code, you can check our GitHub [Issues][github-issues-link], show off your skills, and demonstrate your ideas.\n\n[![][pr-welcome-shield]][pr-welcome-link]\n\n[![][github-contrib-shield]][github-contrib-link]\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## Credits\n\n- **langchainjs** - <https://github.com/hwchase17/langchainjs>\n- **ink** - <https://github.com/vadimdemedes/ink>\n- **transmart** - <https://github.com/Quilljou/transmart>\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n---\n\n#### 📝 License\n\nCopyright © 2024 [Arietta Studio][profile-link]. <br />\nThis project is licensed under the [MIT](./LICENSE) license.\n\n<!-- LINK GROUP -->\n\n[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square\n[bun-link]: https://bun.sh\n[bun-shield]: https://img.shields.io/badge/-speedup%20with%20bun-black?logo=bun&style=for-the-badge\n[github-action-release-link]: https://github.com/arietta-studio/arietta-tools/actions/workflows/release.yml\n[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/arietta-studio/arietta-tools/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square\n[github-action-test-link]: https://github.com/arietta-studio/arietta-tools/actions/workflows/test.yml\n[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/arietta-studio/arietta-tools/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square\n[github-codespace-link]: https://codespaces.new/arietta-studio/arietta-tools\n[github-codespace-shield]: https://github.com/codespaces/badge.svg\n[github-contrib-link]: https://github.com/arietta-studio/arietta-tools/graphs/contributors\n[github-contrib-shield]: https://contrib.rocks/image?repo=arietta-studio%2Farietta-tools\n[github-contributors-link]: https://github.com/arietta-studio/arietta-tools/graphs/contributors\n[github-contributors-shield]: https://img.shields.io/github/contributors/arietta-studio/arietta-tools?color=c4f042&labelColor=black&style=flat-square\n[github-forks-link]: https://github.com/arietta-studio/arietta-tools/network/members\n[github-forks-shield]: https://img.shields.io/github/forks/arietta-studio/arietta-tools?color=8ae8ff&labelColor=black&style=flat-square\n[github-issues-link]: https://github.com/arietta-studio/arietta-tools/issues\n[github-issues-shield]: https://img.shields.io/github/issues/arietta-studio/arietta-tools?color=ff80eb&labelColor=black&style=flat-square\n[github-license-link]: https://github.com/arietta-studio/arietta-tools/blob/master/LICENSE\n[github-license-shield]: https://img.shields.io/github/license/arietta-studio/arietta-tools?color=white&labelColor=black&style=flat-square\n[github-releasedate-link]: https://github.com/arietta-studio/arietta-tools/releases\n[github-releasedate-shield]: https://img.shields.io/github/release-date/arietta-studio/arietta-tools?labelColor=black&style=flat-square\n[github-stars-link]: https://github.com/arietta-studio/arietta-tools/network/stargazers\n[github-stars-shield]: https://img.shields.io/github/stars/arietta-studio/arietta-tools?color=ffcb47&labelColor=black&style=flat-square\n[issues-url]: https://github.com/arietta-studio/arietta-compass/issues/new/choose\n[npm-release-link]: https://www.npmjs.com/package/@arietta-studio/arietta-i18n\n[npm-release-shield]: https://img.shields.io/npm/v/@arietta-studio/arietta-i18n?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square\n[pr-welcome-link]: https://github.com/arietta-studio/arietta-tools/pulls\n[pr-welcome-shield]: https://img.shields.io/badge/%F0%9F%A4%AF%20PR%20WELCOME-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge\n[profile-link]: https://github.com/arietta-studio\n","readmeFilename":"README.md"}