{"id":22688211,"url":"https://github.com/emanuelefavero/react-i18next","last_synced_at":"2026-04-11T01:17:45.303Z","repository":{"id":226168894,"uuid":"767570542","full_name":"emanuelefavero/react-i18next","owner":"emanuelefavero","description":"This is a simple example of how to use i18next with React to translate your application","archived":false,"fork":false,"pushed_at":"2024-03-06T07:29:42.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T16:50:27.931Z","etag":null,"topics":["i18next","locale","react","react-i18next","translation","vite"],"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/emanuelefavero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-03-05T14:32:54.000Z","updated_at":"2024-03-05T14:34:29.000Z","dependencies_parsed_at":"2024-03-06T08:48:15.731Z","dependency_job_id":null,"html_url":"https://github.com/emanuelefavero/react-i18next","commit_stats":null,"previous_names":["emanuelefavero/react-i18next"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelefavero%2Freact-i18next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelefavero%2Freact-i18next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelefavero%2Freact-i18next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanuelefavero%2Freact-i18next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emanuelefavero","download_url":"https://codeload.github.com/emanuelefavero/react-i18next/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207509,"owners_count":20740723,"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":["i18next","locale","react","react-i18next","translation","vite"],"created_at":"2024-12-10T00:13:30.119Z","updated_at":"2025-10-16T02:35:54.617Z","avatar_url":"https://github.com/emanuelefavero.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React i18next\n\nThis is a simple example of how to use i18next with React to translate your application\n\n\u003e Note: `i18next` is a powerful internationalization framework for JavaScript that provides a complete solution to localize and translate your product\n\u003e\n\u003e Note: We are using `Vite` to build this project, but you can use `Next.js` or any other bundler\n\n### Screenshot\n\n\u003cimg src=\"screenshot.png\" alt=\"screenshot\" width=\"300\"\u003e\n\n## How to use\n\n1. Clone this repository\n2. Install the dependencies with `npm install`\n3. Run the project\n\n```bash\nnpm run dev\n```\n\n## How to add a new language\n\n- Create a new file called `translation.json` inside its respective language folder (e.g. `en` for English) and put it inside the `src/locales` folder\n\n```json\n{\n  \"welcome\": \"Hello World\"\n}\n```\n\n- Add the new language to the `i18n.ts` file\n\n```javascript\n// Other code here...\n\n// Import the new language\nimport en from './locales/en/translation.json'\n\n// Add the new language to the resources object\nconst resources = {\n  en: {\n    translation: en,\n  },\n  // Other languages here...\n}\n```\n\n- Add the translation in your React components:\n\n```jsx\nimport './i18n.ts' // * Import the i18n configuration\nimport { useTranslation } from 'react-i18next'\n\nexport default function App() {\n  // * Use the t() function to translate text, and the i18n object to change the language\n  const { t, i18n } = useTranslation()\n\n  return (\n    \u003c\u003e\n      \u003ch1\u003e{t('welcome')}\u003c/h1\u003e\n      \u003cbutton onClick={() =\u003e i18n.changeLanguage('en')}\u003eEnglish\u003c/button\u003e\n    \u003c/\u003e\n  )\n}\n```\n\n## Resources\n\n- [i18next documentation](https://www.i18next.com/)\n- [react-i18next documentation](https://react.i18next.com/)\n- [Vite documentation](https://vitejs.dev/)\n- [Next.js documentation](https://nextjs.org/)\n\n## License\n\n- [MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuelefavero%2Freact-i18next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femanuelefavero%2Freact-i18next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuelefavero%2Freact-i18next/lists"}