{"id":20514445,"url":"https://github.com/alexxandergrib/i18n-typescript-how-to","last_synced_at":"2025-05-09T08:33:00.148Z","repository":{"id":235561547,"uuid":"625270053","full_name":"AlexXanderGrib/i18n-typescript-how-to","owner":"AlexXanderGrib","description":"TypeScript + i18n done properly","archived":true,"fork":false,"pushed_at":"2023-04-08T15:39:08.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T23:16:02.074Z","etag":null,"topics":["i18n","typesafe","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexXanderGrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-04-08T15:36:52.000Z","updated_at":"2024-07-16T10:49:02.000Z","dependencies_parsed_at":"2024-04-23T21:30:08.789Z","dependency_job_id":null,"html_url":"https://github.com/AlexXanderGrib/i18n-typescript-how-to","commit_stats":null,"previous_names":["alexxandergrib/i18n-typescript-how-to"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fi18n-typescript-how-to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fi18n-typescript-how-to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fi18n-typescript-how-to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fi18n-typescript-how-to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexXanderGrib","download_url":"https://codeload.github.com/AlexXanderGrib/i18n-typescript-how-to/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253217273,"owners_count":21873055,"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","typesafe","typescript"],"created_at":"2024-11-15T21:16:41.695Z","updated_at":"2025-05-09T08:32:59.813Z","avatar_url":"https://github.com/AlexXanderGrib.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript + i18n done properly\n\n**All source in [`i18n/`](./i18n)**\n\n- Absolute type safety, no more \"`translation.common.app.name`\"\n- Works with TypeScript 4.9+\n- Requires no interaction with `fs` or `fetch`. All done by your bundler/runtime\n- Caches loaded locales.\n- No codegen\n\n\n## Example (Next.JS)\n\n```typescript\n// @/i18n/locales/en/index.ts\n\nexport const en = {\n  hello: \"Hello world!\"\n}\n\n```\n\n```tsx\n// pages/index.tsx\nimport { loadLocale, checkLocale } from \"@/i18n\";\nimport type { GetStaticProps, InferGetStaticPropsType } from \"next\"\n\nexport function getStaticProps({ locale }) {\n  return {\n    props: {\n      translation: await loadLocale(checkLocale(locale))\n    }\n  }\n} satisfies GetStaticProps;\n\nexport function Home({ translation }: InferGetStaticPropsType\u003ctypeof getStaticProps\u003e) {\n  return \u003ch1\u003e{translation.hello}\u003c/h1\u003e;\n  //                      ^? (property) hello: string \n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexxandergrib%2Fi18n-typescript-how-to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexxandergrib%2Fi18n-typescript-how-to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexxandergrib%2Fi18n-typescript-how-to/lists"}