{"id":14754280,"url":"https://github.com/i18n-pro/core","last_synced_at":"2025-04-23T13:43:04.767Z","repository":{"id":41299882,"uuid":"502261934","full_name":"i18n-pro/core","owner":"i18n-pro","description":"A lightweight, simple, flexible, automatic translation tool for JavaScript（适用于 JavaScript 的轻量、简单、灵活、自动翻译的国际化工具）","archived":false,"fork":false,"pushed_at":"2024-08-01T15:16:25.000Z","size":2562,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T08:09:44.128Z","etag":null,"topics":["auto-translation","automatic-translation","i18n","javascript","machine-translation","react-i18n","react-intl","solid-i18n","svelte-i18n","translator","vue-i18n"],"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/i18n-pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-06-11T05:45:25.000Z","updated_at":"2024-12-08T06:10:57.000Z","dependencies_parsed_at":"2024-04-02T15:27:06.696Z","dependency_job_id":"3606baf2-09aa-43aa-8e0c-f6136c8d2396","html_url":"https://github.com/i18n-pro/core","commit_stats":{"total_commits":225,"total_committers":2,"mean_commits":112.5,"dds":0.004444444444444473,"last_synced_commit":"ba89d1b1c93a51c10dadea7218e8061c66b8f91e"},"previous_names":["i18n-pro/core","eyelly-wu/i18n-pro"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i18n-pro","download_url":"https://codeload.github.com/i18n-pro/core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250441267,"owners_count":21431140,"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":["auto-translation","automatic-translation","i18n","javascript","machine-translation","react-i18n","react-intl","solid-i18n","svelte-i18n","translator","vue-i18n"],"created_at":"2024-09-15T08:01:34.886Z","updated_at":"2025-04-23T13:43:04.749Z","avatar_url":"https://github.com/i18n-pro.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n[![logo](https://s3.bmp.ovh/imgs/2022/06/25/3a1c742f283cf28e.png \"logo\")](https://github.com/i18n-pro/core \"github\")\n\n\nEnglish | [简体中文](https://github.com/i18n-pro/core/blob/v2.1.1/README_zh-CN.md)\n\n\n  \u003cp style=\"font-size: 18px;\"\u003eLightweight, simple, flexible, automatic translation internationalization tool for JavaScript\u003c/p\u003e\n\n[![npm-version](https://img.shields.io/npm/v/i18n-pro.svg?style=flat-square \"npm-version\")](https://www.npmjs.com/package/i18n-pro \"npm\")\n[![npm-download](https://img.shields.io/npm/dm/i18n-pro \"npm-download\")](https://www.npmjs.com/package/i18n-pro \"npm\")\n\n[![github-stars](https://img.shields.io/github/stars/i18n-pro/core?style=social \"github-stars\")](https://github.com/i18n-pro/core/stargazers \"github-stars\")\n[![last-commit](https://img.shields.io/github/last-commit/i18n-pro/core/dev \"last-commit\")](https://github.com/i18n-pro/core/commits/dev \"last-commit\")\n[![github-issues](https://img.shields.io/github/issues-raw/i18n-pro/core \"github-issues\")](https://github.com/i18n-pro/core/issues \"github-issues\")\n[![codecov](https://codecov.io/gh/i18n-pro/core/branch/main/graph/badge.svg?token=758C46SIE7 \"codecov\")](https://codecov.io/gh/i18n-pro/core \"codecov\")\n\n![demo](https://s3.bmp.ovh/imgs/2023/06/06/c3261b545825fc71.gif)\n\n\u003c/div\u003e\n\u003cdetails \u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n\n  [Vision](#vision)\u003cbr/\u003e\n  [Features](#features)\u003cbr/\u003e\n  [Live Demo](#live-demo)\u003cbr/\u003e\n  [Principle](#principle)\u003cbr/\u003e\n  [Help Document](#help-document)\u003cbr/\u003e\n  [License](#license)\u003cbr/\u003e\n\n\u003c/details\u003e\n\n\n# Vision\nTo make internationalization easy and enjoyable 😄💪🏻\n# Features\n\n* **lightweight**：[![bundlesize](https://img.shields.io/bundlephobia/minzip/i18n-pro?color=brightgreen\u0026style=plastic \"bundlesize\")](https://bundlephobia.com/package/i18n-pro \"bundlesize\")\n* **simple**：Low learning cost and easy to use\n* **flexible**：Support  `Variable Interpolation` , as well as unique type tag and formatting callbacks (numbers, currency, dates, times, plurals)\n* **automatic-translation**：One command can automatically extract text and translate it to generate language packs\n   * **Support incremental translation mode**：Only translate new text and intelligently remove unused text\n   * **Support multi -translation platform**：Google x、OpenAI、Google、Microsoft、Tencent、Alibaba Cloud、Youdao、Baidu（In addition to Google x, other platforms need to register an account by themselves）\n   * **Support multiple translation logs**：The output of a variety of types of translation logs, which is convenient for tracking and positioning translation issues\n* **keyless**：No need to manually define key,  `Translation Text`  is key\n\n\n# Live Demo\n\n* [Open in CodeSandbox](https://codesandbox.io/p/github/i18n-pro/core-demo/main?file=README.md)\n* [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz_small.svg \"Open in StackBlitz\")](https://stackblitz.com/github/i18n-pro/core-demo?file=README.md)\n\n\n# Principle\n\n\u003eTaking  `Translation Text`  as key is the key to all the functions of the library. If you have any questions about this, [Please see](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/Q\u0026A.md)\n\nThe library is mainly composed of two parts\n* Command Line Tool\n* Function API\n\n**Command Line Tool**：Parse the text that needs to be translated based on specified rules (regular expressions), translate the text to the specified target language through a translation platform, and finally generate language pack files\n\nAn example of parsing text using  [Matching Rules](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/MATCH_RULE.md)  is as follows:\n```js\n/** Normal string */\n\nt('hello world')\nt(\"hello world\")\nt(`hello world`)\n\n\n/** Support Variable Interpolation */\n\nt('hello {0}', 'developer friends'),\nt('This is {0}, welcome to {1}. If you think {2}, please give {3} your support', ' `i18n-pro` ', 'use', `it's helpful for you`, ' ⭐️ ')\n\n\n/** Interpolation Variable type tag need to be used with corresponding formatting callbacks */\n\n// Number Type\nt('The number of users has reached {n0}', 100000000)\n\n// Currency Type\nt('The selling price is {c0}', 14999)\n\n// Date Type\nt(`Today's date is {d0}`, new Date())\n\n// Time Type\nt('Current time: {t0}', new Date())\n\n// Plural Type\nt('I have {p0 apple}, {p1 banana} and {p2 pear}', 5, 4, 3) \n```\n**Function API**：Connect the international language package into the project, consisting of  `initI18n` ,  `t` ,  `setI18n`  and  `withI18n` \n* **initI18n**：Used to initialize the fixed configuration, and finally return the objects containing the following 3 APIs\n* **t**：It is used for wrapping  `Translation Text`  to achieve internationalization, and it is also used as a logo of the command line to match  `Translation Text`  rules\n* **setI18n**：Set language and language package\n* **withI18n**：It is applicable to the server. Each interface response needs to be internationalized\n\nTherefore,  `Command Line Tool`  and  `Function API`  work better together. It is precisely because of this structural design that  `i18n-pro`  library can be easily integrated into any  `JavaScript`  project\n# Help Document\n\n* [Quick Start](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/USAGE.md)\n* [Command Line](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/COMMAND_LINE.md)\n* [API](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/API.md)\n* [Matching Rules](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/MATCH_RULE.md)\n* [Translation Log](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/OUTPUT_LOG.md)\n* [Q\u0026A](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/Q\u0026A.md)\n* [Contribution Guidelines](https://github.com/i18n-pro/core/blob/dev/docs/dist/CONTRIBUTION_GUIDELINES.md)\n* [Changelog](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/CHANGELOG.md)\n\n\n# License\n[MIT](./LICENSE)\n\nCopyright (c) 2022-present Eyelly Wu","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18n-pro%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi18n-pro%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18n-pro%2Fcore/lists"}