{"id":13400575,"url":"https://github.com/i18next/react-i18next","last_synced_at":"2025-09-09T20:37:45.045Z","repository":{"id":37601939,"uuid":"47878060","full_name":"i18next/react-i18next","owner":"i18next","description":"Internationalization for react done right. Using the i18next i18n ecosystem.","archived":false,"fork":false,"pushed_at":"2025-05-05T15:11:37.000Z","size":19581,"stargazers_count":9533,"open_issues_count":29,"forks_count":1037,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-05-05T15:56:21.547Z","etag":null,"topics":["i18n","i18next","internationalization","react","react-native","ssr","translation"],"latest_commit_sha":null,"homepage":"https://react.i18next.com","language":"JavaScript","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/i18next.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null},"funding":{"github":["jamuhl","adrai"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://locize.com"}},"created_at":"2015-12-12T12:52:11.000Z","updated_at":"2025-05-05T15:11:42.000Z","dependencies_parsed_at":"2024-06-21T19:02:19.887Z","dependency_job_id":"291148eb-55be-4d9e-9a3f-c02b81f457c8","html_url":"https://github.com/i18next/react-i18next","commit_stats":{"total_commits":1516,"total_committers":201,"mean_commits":7.54228855721393,"dds":0.579155672823219,"last_synced_commit":"badba254ccdd16145f5b0628babaad1efffc8448"},"previous_names":[],"tags_count":318,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Freact-i18next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Freact-i18next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Freact-i18next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i18next%2Freact-i18next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i18next","download_url":"https://codeload.github.com/i18next/react-i18next/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253797802,"owners_count":21965965,"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":["i18n","i18next","internationalization","react","react-native","ssr","translation"],"created_at":"2024-07-30T19:00:53.497Z","updated_at":"2025-05-12T18:30:23.661Z","avatar_url":"https://github.com/i18next.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jamuhl","https://github.com/sponsors/adrai","https://locize.com"],"categories":["Utilities","Uncategorized","十三、国际化（i18n）","Internationalization \u0026 Localization","JavaScript","📖 Categories","React [🔝](#readme)"],"sub_categories":["i18n","Uncategorized","3.  Immutable 工具（辅助状态管理）","React i18n"],"readme":"# react-i18next [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Awesome%20react-i18next%20for%20react.js%20based%20on%20i18next%20internationalization%20ecosystem%20\u0026url=https://github.com/i18next/react-i18next\u0026via=jamuhl\u0026hashtags=i18n,reactjs,js,dev)\n\n[![CI](https://github.com/i18next/react-i18next/actions/workflows/CI.yml/badge.svg)](https://github.com/i18next/react-i18next/actions/workflows/CI.yml)\n[![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/i18next/react-i18next)\n[![Coverage Status](https://coveralls.io/repos/github/i18next/react-i18next/badge.svg)](https://coveralls.io/github/i18next/react-i18next)\n[![Quality][quality-badge]][quality-url]\n[![npm][npm-dl-badge]][npm-url]\n\n[npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true\n[npm-url]: https://npmjs.org/package/react-i18next\n[quality-badge]: https://npm.packagequality.com/shield/react-i18next.svg\n[quality-url]: https://packagequality.com/#?package=react-i18next\n[npm-dl-badge]: https://img.shields.io/npm/dw/react-i18next\n\n### IMPORTANT:\n\nMaster Branch is the newest version using hooks (\u003e= v10).\n\n```bash\n$ \u003e=v10.0.0\nnpm i react-i18next\n```\n\n**react-native: To use hooks within react-native, you must use react-native v0.59.0 or higher**\n\nFor the legacy version please use the [v9.x.x Branch](https://github.com/i18next/react-i18next/tree/v9.x.x)\n\n```bash\n$ v9.0.10 (legacy)\nnpm i react-i18next@legacy\n```\n\n### Documentation\n\nThe documentation is published on [react.i18next.com](https://react.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/react-i18next-gitbook).\n\nThe general i18next documentation is published on [www.i18next.com](https://www.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/i18next-gitbook).\n\n### What will my code look like?\n\n**Before:** Your react code would have looked something like:\n\n```html\n...\n\u003cdiv\u003eJust simple content\u003c/div\u003e\n\u003cdiv\u003e\n  Hello \u003cstrong title=\"this is your name\"\u003e{name}\u003c/strong\u003e, you have {count} unread message(s). \u003cLink to=\"/msgs\"\u003eGo to messages\u003c/Link\u003e.\n\u003c/div\u003e\n...\n```\n\n**After:** With the trans component just change it to:\n\n```html\n...\n\u003cdiv\u003e{t('simpleContent')}\u003c/div\u003e\n\u003cTrans i18nKey=\"userMessagesUnread\" count={count}\u003e\n  Hello \u003cstrong title={t('nameTitle')}\u003e{{name}}\u003c/strong\u003e, you have {{count}} unread message. \u003cLink to=\"/msgs\"\u003eGo to messages\u003c/Link\u003e.\n\u003c/Trans\u003e\n...\n```\n\n### 📖 What others say\n\n- [How to properly internationalize a React application using i18next](https://locize.com/blog/react-i18next/) by Adriano Raiano\n- [I18n with React and i18next](https://alligator.io/react/i18n-with-react-and-i18next) via Alligator.io by Danny Hurlburt\n- [Ultimate Localization of React (Mobx) App with i18next](https://itnext.io/ultimate-localization-of-react-mobx-app-with-i18next-efab77712149) via itnext.io by Viktor Shevchenko\n- [Internationalization for react done right Using the i18next i18n ecosystem](https://reactjsexample.com/internationalization-for-react-done-right-using-the-i18next-i18n-ecosystem/) via reactjsexample.com\n- [How to translate React application with react-i18next](https://codetain.com/blog/how-to-translate-react-application-with-react-i18next/) via codetain.co by Norbert Suski\n- [Building i18n with Gatsby](https://www.gatsbyjs.org/blog/2017-10-17-building-i18n-with-gatsby/) via gatsbyjs.org by Samuel Goudie\n- [Get your react.js application translated with style](https://medium.com/@jamuhl/get-your-react-js-application-translated-with-style-4ad090aefc2c) by Jan Mühlemann\n- [Translate your expo.io / react-native mobile application](https://medium.com/@jamuhl/translate-your-expo-io-react-native-mobile-application-aa220b2362d2) by Jan Mühlemann\n- You're welcome to share your story...\n\n### Why i18next?\n\n- **Simplicity:** no need to change your webpack configuration or add additional babel transpilers, just use create-react-app and go.\n- **Production ready** we know there are more needs for production than just doing i18n on the clientside, so we offer wider support on [serverside](https://www.i18next.com/overview/supported-frameworks) too (nodejs, php, ruby, .net, ...). **Learn once - translate everywhere**.\n- **Beyond i18n** comes with [locize](https://locize.com) bridging the gap between development and translations - covering the whole translation process.\n\n![ecosystem](https://raw.githubusercontent.com/i18next/i18next/master/assets/i18next-ecosystem.jpg)\n\n### Localization workflow\n\nWant to learn more about how seamless your internationalization and translation process can be?\n\n[![video](example/locize/video_sample.png)](https://youtu.be/osScyaGMVqo)\n\n[watch the video](https://youtu.be/osScyaGMVqo)\n\n### Installation\n\nSource can be loaded via [npm](https://www.npmjs.com/package/react-i18next) or [downloaded](https://github.com/i18next/react-i18next/blob/master/react-i18next.min.js) from this repo.\n\n```\n# npm package\n$ npm install react-i18next\n```\n\n- If you don't use a module loader it will be added to `window.reactI18next`\n\n### Do you like to read a more complete step by step tutorial?\n\n[Here](https://locize.com/blog/react-i18next/) you'll find a simple tutorial on how to best use react-i18next.\nSome basics of i18next and some cool possibilities on how to optimize your localization workflow.\n\n### Examples\n\n- [Example react](https://github.com/i18next/react-i18next/tree/master/example/react)\n- [React examples with typescript](https://github.com/i18next/react-i18next/tree/master/example/react-typescript)\n- [Example locize.com](https://github.com/i18next/react-i18next/tree/master/example/locize)\n\n#### v9 samples\n\n- [Example react](https://github.com/i18next/react-i18next/tree/v9.x.x/example/react)\n- [Example preact](https://github.com/i18next/react-i18next/tree/v9.x.x/example/preact)\n- [Example react-native](https://github.com/i18next/react-i18next/tree/v9.x.x/example/reactnative-expo)\n- [Example expo.io](https://github.com/i18next/react-i18next/tree/v9.x.x/example/reactnative-expo)\n- [Example next.js](https://github.com/i18next/react-i18next/tree/v9.x.x/example/nextjs)\n- [Example razzle](https://github.com/i18next/react-i18next/tree/v9.x.x/example/razzle-ssr)\n- [Example hashbase / beaker browser](https://github.com/i18next/react-i18next/tree/v9.x.x/example/dat)\n- [Example storybook](https://github.com/i18next/react-i18next/tree/v9.x.x/example/storybook)\n- [Example locize.com](https://github.com/i18next/react-i18next/tree/v9.x.x/example/locize)\n- [Example test with jest](https://github.com/i18next/react-i18next/tree/v9.x.x/example/test-jest)\n\n### Requirements\n\n- react \u003e= **16.8.0**\n- react-dom \u003e= **16.8.0**\n- react-native \u003e= **0.59.0**\n- i18next \u003e= **10.0.0** (typescript users: \u003e=17.0.9)\n\n#### v9\n\n- react \u003e= **0.14.0** (in case of \u003c v16 or preact you will need to define parent in [Trans component](https://react.i18next.com/legacy-v9/trans-component#trans-props) or globally in [i18next.react options](https://react.i18next.com/legacy-v9/trans-component#additional-options-on-i-18-next-init))\n- i18next \u003e= **2.0.0**\n\n## Core Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://twitter.com/jamuhl\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/977772?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJan Mühlemann\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/i18next/react-i18next/commits?author=jamuhl\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#example-jamuhl\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Ajamuhl+\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/commits?author=jamuhl\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#question-jamuhl\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://twitter.com/#!/adrirai\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/1086194?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdriano Raiano\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/i18next/react-i18next/commits?author=adrai\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#example-adrai\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Aadrai+\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/commits?author=adrai\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#question-adrai\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/pedrodurek\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/12190482?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePedro Durek\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/i18next/react-i18next/commits?author=pedrodurek\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#example-pedrodurek\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Apedrodurek+\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#question-pedrodurek\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://tigerabrodi.dev/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/49603590?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTiger Abrodi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/i18next/react-i18next/commits?author=tigerabrodi\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Atigerabrodi\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!\n\n---\n\n\u003ch3 align=\"center\"\u003eGold Sponsors\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://locize.com/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/i18next/i18next/master/assets/locize_sponsor_240.gif\" width=\"240px\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**localization as a service - locize.com**\n\nNeeding a translation management? Want to edit your translations with an InContext Editor? Use the original provided to you by the maintainers of i18next!\n\n![locize](https://cdn.prod.website-files.com/67a323e323a50df7f24f0a6f/67b8bbb29365c3a3c21c0898_github_locize.png)\n\nBy using [locize](http://locize.com/?utm_source=react_i18next_readme\u0026utm_medium=github) you directly support the future of i18next and react-i18next.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18next%2Freact-i18next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi18next%2Freact-i18next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi18next%2Freact-i18next/lists"}