{"id":17973928,"url":"https://github.com/i18n-pro/react","last_synced_at":"2025-03-25T14:31:48.332Z","repository":{"id":191658581,"uuid":"600414204","full_name":"i18n-pro/react","owner":"i18n-pro","description":"Lightweight, simple, flexible, automatic translation internationalization tool for React（适用于 React 的轻量、简单、灵活、自动翻译的国际化工具）","archived":false,"fork":false,"pushed_at":"2024-09-21T13:11:47.000Z","size":889,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T14:59:02.294Z","etag":null,"topics":["auto-translation","automatic-translation","i18n","i18n-pro","machine-translation","react","react-i18n","react-intl","react-native","translator"],"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":"2023-02-11T12:23:20.000Z","updated_at":"2024-09-21T13:10:59.000Z","dependencies_parsed_at":"2023-08-31T00:46:45.267Z","dependency_job_id":"a8d50b1a-1671-424e-9261-2db6224aa041","html_url":"https://github.com/i18n-pro/react","commit_stats":null,"previous_names":["i18n-pro/react"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Freact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Freact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Freact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18n-pro%2Freact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i18n-pro","download_url":"https://codeload.github.com/i18n-pro/react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245480444,"owners_count":20622321,"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","i18n-pro","machine-translation","react","react-i18n","react-intl","react-native","translator"],"created_at":"2024-10-29T17:05:07.574Z","updated_at":"2025-03-25T14:31:47.958Z","avatar_url":"https://github.com/i18n-pro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp style=\"font-size: 18px;\"\u003eLightweight, simple, flexible, automatic translation internationalization tool for React\u003c/p\u003e\n\nEnglish | [简体中文](https://github.com/i18n-pro/react/blob/v1.0.1/README_zh-CN.md)\n\n\n\n[![npm-version](https://img.shields.io/npm/v/@i18n-pro/react.svg?style=flat-square \"npm-version\")](https://www.npmjs.com/package/@i18n-pro/react \"npm\")\n[![npm-download](https://img.shields.io/npm/dm/@i18n-pro/react \"npm-download\")](https://www.npmjs.com/package/@i18n-pro/react \"npm\")\n\n[![github-stars](https://img.shields.io/github/stars/i18n-pro/react?style=social \"github-stars\")](https://github.com/i18n-pro/react/stargazers \"github-stars\")\n[![last-commit](https://img.shields.io/github/last-commit/i18n-pro/react/main \"last-commit\")](https://github.com/i18n-pro/react/commits/main \"last-commit\")\n[![github-issues](https://img.shields.io/github/issues-raw/i18n-pro/react \"github-issues\")](https://github.com/i18n-pro/react/issues \"github-issues\")\n[![codecov](https://codecov.io/gh/i18n-pro/react/branch/main/graph/badge.svg?token=GQ6S1GPFCM \"codecov\")](https://codecov.io/gh/i18n-pro/react \"codecov\")\n\n![demo](https://s3.bmp.ovh/imgs/2023/08/28/5c842995a00d48ae.gif)\n\n\u003c/div\u003e\n\u003cdetails \u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n\n  [Vision](#vision)\u003cbr/\u003e\n  [Requirement](#requirement)\u003cbr/\u003e\n  [Features](#features)\u003cbr/\u003e\n  [Live Demo](#live-demo)\u003cbr/\u003e\n  [Principle](#principle)\u003cbr/\u003e\n  [License](#license)\u003cbr/\u003e\n\n\u003c/details\u003e\n\n\n# Vision\nTo make internationalization easy and enjoyable 😄💪🏻\n# Requirement\n\n* react \u003e= **16.8.0**\n* react-dom \u003e= **16.8.0**\n* react-native \u003e= **0.59.0**\n* i18n-pro \u003e= **2.0.0**\n\n\n# Features\n\n* **lightweight**：[![bundlesize](https://img.shields.io/bundlephobia/minzip/i18n-pro?color=brightgreen\u0026style=plastic \"i18n-pro-bundlesize\")](https://bundlephobia.com/package/i18n-pro \"i18n-pro-bundlesize\") + [![bundlesize](https://img.shields.io/bundlephobia/minzip/@i18n-pro/react?color=brightgreen\u0026style=plastic \"bundlesize\")](https://bundlephobia.com/package/@i18n-pro/react \"bundlesize\")\n* The following features are inherited from  [i18n-pro](https://github.com/i18n-pro/core \"i18n-pro\") \n   * **simple**\n   * **flexible**\n   * **automatic-translation**\n   * **keyless**\n\n\n# Live Demo\n\n* [Open in CodeSandbox](https://codesandbox.io/p/github/i18n-pro/react-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/react-demo?file=README.md)\n\n\n# Principle\nThis library is implemented based on  [i18n-pro](https://github.com/i18n-pro/core \"i18n-pro\")  combined with  `React` 's  `context`  feature\n\nMainly composed of  `2`  parts\n* I18nProvider\n* useI18n\n\n\n\n**I18nProvider**：Configure container components for internationalization initialization properties\n\n**useI18n**：Hook method for obtaining internationalization API and state\n\n\n\nA simple example is as follows\n```typescript react\nimport React from 'react'\nimport { render } from 'react-dom'\nimport { I18nProvider, useI18n } from '@i18n-pro/react'\n\nfunction App() {\n  const { t } = useI18n()\n\n  return \u003c\u003e{t('hello world')}\u003c/\u003e\n}\n\nrender(\n  \u003cI18nProvider\n    namespace=\"i18n-example\"\n    locale=\"en\"\n    langs={{\n      zh: {\n        'hello world': '你好世界',\n      },\n      ja:{\n        \"hello world\": \"こんにちは世界\",\n      },\n    }}\n  \u003e\n    \u003cApp /\u003e\n  \u003c/I18nProvider\u003e,\n  document.getElementById('root'),\n)\n```\n\n# Help Document\n\n\u003eTo avoid unnecessary duplicate document content, some of the documents in this library are linked to the content in  `i18n-pro` \u003cbr /\u003eThe  `i18n-pro`  related link in the current document is based on the  `2.1.1`  version. If you are using a different version, you need to check the document corresponding to the version you are using to avoid inconsistent usage\n* Current Library\n   * [Quick Start](https://github.com/i18n-pro/react/blob/v1.0.1/docs/dist/USAGE.md)\n   * [API](https://github.com/i18n-pro/react/blob/v1.0.1/docs/dist/API.md)\n   * [Changelog](https://github.com/i18n-pro/react/blob/v1.0.1/docs/dist/CHANGELOG.md)\n* i18n-pro\n   * [Command Line](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/COMMAND_LINE.md)\n   * [Matching Rules](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/MATCH_RULE.md)\n   * [Q\u0026A](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/Q\u0026A.md)\n   * [Translation log](https://github.com/i18n-pro/core/blob/v2.1.1/docs/dist/OUTPUT_LOG.md)\n\n\n# License\n[MIT](./LICENSE)\n\nCopyright (c) 2023-present Eyelly Wu","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18n-pro%2Freact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi18n-pro%2Freact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18n-pro%2Freact/lists"}