{"id":24455408,"url":"https://github.com/reactwaylabs/typed-i18next","last_synced_at":"2026-03-06T21:31:21.539Z","repository":{"id":39659678,"uuid":"202111946","full_name":"reactwaylabs/typed-i18next","owner":"reactwaylabs","description":"Type-safe translations generator for i18next.","archived":false,"fork":false,"pushed_at":"2023-01-04T09:14:39.000Z","size":1098,"stargazers_count":7,"open_issues_count":12,"forks_count":3,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-11-27T12:02:10.091Z","etag":null,"topics":["cli","i18next","strict-types","translations","type-safe","typescript"],"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/reactwaylabs.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}},"created_at":"2019-08-13T09:35:48.000Z","updated_at":"2024-01-28T15:46:46.000Z","dependencies_parsed_at":"2023-02-02T06:31:52.066Z","dependency_job_id":null,"html_url":"https://github.com/reactwaylabs/typed-i18next","commit_stats":null,"previous_names":["reactway/typed-i18next"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/reactwaylabs/typed-i18next","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactwaylabs%2Ftyped-i18next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactwaylabs%2Ftyped-i18next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactwaylabs%2Ftyped-i18next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactwaylabs%2Ftyped-i18next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactwaylabs","download_url":"https://codeload.github.com/reactwaylabs/typed-i18next/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactwaylabs%2Ftyped-i18next/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30198661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","i18next","strict-types","translations","type-safe","typescript"],"created_at":"2025-01-21T02:13:22.327Z","updated_at":"2026-03-06T21:31:21.502Z","avatar_url":"https://github.com/reactwaylabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typed-i18next\r\n\r\nType-safe translations generator for i18next.\r\n\r\n[![NPM version](https://img.shields.io/npm/v/typed-i18next.svg?logo=npm)](https://www.npmjs.com/package/typed-i18next)\r\n[![NPM version](https://img.shields.io/npm/v/typed-i18next/canary.svg?logo=npm)](https://www.npmjs.com/package/typed-i18next/v/canary)\r\n\r\n[![Build Status](https://img.shields.io/azure-devops/build/reactway/reactway/17/master.svg?logo=azuredevops)](https://dev.azure.com/reactway/ReactWay/_build/latest?definitionId=17\u0026branchName=master)\r\n[![Code coverage](https://img.shields.io/azure-devops/coverage/reactway/reactway/17/master.svg)](https://dev.azure.com/reactway/ReactWay/_build/latest?definitionId=17\u0026branchName=master)\r\n\r\n[![Dependencies](https://img.shields.io/david/reactway/typed-i18next.svg)](https://david-dm.org/reactway/typed-i18next)\r\n[![Dev dependencies](https://img.shields.io/david/dev/reactway/typed-i18next.svg)](https://david-dm.org/reactway/typed-i18next?type=dev)\r\n\r\n## Features\r\n\r\n-   [x] Generates TypeScript declaration file.\r\n-   [x] Check if generated declaration file is up-to-date (useful for CI).\r\n-   [x] Support [folder structure](#folder-structure): `[languageName]/**/[namespace].json`.\r\n-   [ ] Support file structure: `[languageName].json`.\r\n-   [ ] Combine translations keys from different sources.\r\n-   [x] Strictly typed `const { t } = useTranslation()` from `react-i18next` package. [Example](#react-i18next)\r\n\r\n## Get started\r\n\r\nInstall `typed-i18next` package.\r\n\r\n```sh\r\n$ npm install typed-i18next\r\n```\r\n\r\nLatest `dev` build is published under canary tag.\r\n\r\n```sh\r\n$ npm install typed-i18next@canary\r\n```\r\n\r\nTo start using the tool:\r\n\r\n```sh\r\n$ typed-i18next -h\r\n```\r\n\r\n### Example\r\n\r\nWhen generating TypeScript types:\r\n\r\n```sh\r\n$ typed-i18next -i ./src/i18next/translations -o ./src/i18next/translations.d.ts\r\n```\r\n\r\nDuring CI, declaration file can be checked if they are up-to-date with `--check` flag:\r\n\r\n```sh\r\n$ typed-i18next -i ./src/i18next/translations -o ./src/i18next/translations.d.ts --check\r\n```\r\n\r\n## CLI Usage\r\n\r\n```sh\r\n$ typed-i18next -h\r\n```\r\n\r\n### Configuration\r\n\r\n| CLI Flag                       | Type                                                               | Description                                         | Default  |\r\n| ------------------------------ | ------------------------------------------------------------------ | --------------------------------------------------- | -------- |\r\n| -i, --input \\\u003cpath\\\u003e           | string                                                             | Location where translations are located.            |          |\r\n| -o, --outputFile \\\u003cfile-path\\\u003e | string                                                             | Location where to generate definitions file.        |          |\r\n| --check [boolean]              | boolean                                                            | Check if generated file up to date (useful for CI). | false    |\r\n| --logLevel \\\u003clevel\\\u003e           | `\"silent\"`, `\"error\"`, `\"warning\"`, `\"info\"`, `\"debug\"`, `\"trace\"` | Console log level.                                  | `\"info\"` |\r\n\r\n## Translation file structures\r\n\r\n### Folder structure\r\n\r\nExample translations file structure:\r\n\r\n```\r\n.\r\n└── translations/\r\n    ├── en/\r\n    │   ├── commons.json\r\n    │   ├── validation.json\r\n    │   ├── glosarry.json\r\n    │   └── pages/\r\n    │       ├── login.json\r\n    │       └── register.json\r\n    └── lt/\r\n        ├── commons.json\r\n        ├── validation.json\r\n        ├── glosarry.json\r\n        └── pages/\r\n            ├── login.json\r\n            └── register.json\r\n```\r\n\r\n## Library specific types\r\n\r\n### `react-i18next`\r\n\r\n```ts\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { StrictTypedTranslations } from \"typed-i18next/react\";\r\n// Declaration file \"translations.d.ts\" that we generated with `typed-i18next` tool.\r\nimport { Translations } from \"./translations\";\r\n\r\nexport const useStrictTranslation = useTranslation as StrictTypedTranslations\u003ctypeof useTranslation, Translations\u003e;\r\n```\r\n\r\n## License\r\n\r\nReleased under the [MIT license](LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactwaylabs%2Ftyped-i18next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactwaylabs%2Ftyped-i18next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactwaylabs%2Ftyped-i18next/lists"}