{"id":13598783,"url":"https://github.com/ToonvanStrijp/nestjs-i18n","last_synced_at":"2025-04-10T09:32:07.570Z","repository":{"id":37458363,"uuid":"177433564","full_name":"toonvanstrijp/nestjs-i18n","owner":"toonvanstrijp","description":"The i18n module for nestjs.","archived":false,"fork":false,"pushed_at":"2025-03-27T07:41:44.000Z","size":13936,"stargazers_count":672,"open_issues_count":48,"forks_count":122,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T01:04:46.307Z","etag":null,"topics":["i18n","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://nestjs-i18n.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toonvanstrijp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-03-24T15:33:10.000Z","updated_at":"2025-04-09T01:03:36.000Z","dependencies_parsed_at":"2024-01-04T02:38:00.521Z","dependency_job_id":"7e346003-68ce-4869-b5e7-82a50cccf2d5","html_url":"https://github.com/toonvanstrijp/nestjs-i18n","commit_stats":{"total_commits":612,"total_committers":71,"mean_commits":8.619718309859154,"dds":0.553921568627451,"last_synced_commit":"e71196e1fb1fe9025a5b7926a95ee588cfce704d"},"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toonvanstrijp%2Fnestjs-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toonvanstrijp%2Fnestjs-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toonvanstrijp%2Fnestjs-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toonvanstrijp%2Fnestjs-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toonvanstrijp","download_url":"https://codeload.github.com/toonvanstrijp/nestjs-i18n/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144089,"owners_count":21054866,"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","nestjs","nodejs","typescript"],"created_at":"2024-08-01T17:00:56.309Z","updated_at":"2025-04-10T09:32:07.540Z","avatar_url":"https://github.com/toonvanstrijp.png","language":"TypeScript","funding_links":[],"categories":["Components \u0026 Libraries","资源"],"sub_categories":["组件和库"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://nestjs-i18n.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://nestjs-i18n.com/img/logo.svg\" width=\"600\" alt=\"nestjs-i18n Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  The i18n library for \u003ca href=\"https://nestjs.com\" target=\"_blank\"\u003enestjs\u003c/a\u003e. It makes working with languages in your nestjs project easy. Everything is made to be highly configurable. You can write and plug-in your own language resolvers or loaders.\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/nestjs-i18n\" target=\"_blank\"\u003e\u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/nestjs-i18n\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/nestjs-i18n\" target=\"_blank\"\u003e\u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/l/nestjs-i18n\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/toonvanstrijp/nestjs-i18n/actions/workflows/test.yaml\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/toonvanstrijp/nestjs-i18n/actions/workflows/test.yaml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/nestjs-i18n\" target=\"_blank\"\u003e\u003cimg alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/nestjs-i18n\" /\u003e\u003c/a\u003e\n     \u003ca href=\"https://coveralls.io/github/toonvanstrijp/nestjs-i18n?branch=main\" target=\"_blank\"\u003e\u003cimg alt=\"coverage\" src=\"https://coveralls.io/repos/github/toonvanstrijp/nestjs-i18n/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Features\n\n**nestjs-i18n** comes with a bunch of tools to help add multiple language support to your project.\n\n- **Type safety** 🎉 ([instructions](https://nestjs-i18n.com/guides/type-safety))\n- **Variable formatting** ([instructions](https://nestjs-i18n.com/guides/formatting))\n- **Fallback** languages ([instructions](https://nestjs-i18n.com/guides/fallback-languages))\n- **Live** reloading 🎉\n- **Plurals** support ([instructions](https://nestjs-i18n.com/guides/plurals))\n- **GraphQL** support ([instructions](https://nestjs-i18n.com/guides/graphql))\n- **gRPC** support ([instructions](https://nestjs-i18n.com/guides/grpc))\n- **DTO** validation ([instructions](https://nestjs-i18n.com/guides/dto_validation/global-validation))\n- View engine support ([**hbs**](https://nestjs-i18n.com/guides/view_engines/handlebars) or [**pug**](https://nestjs-i18n.com/guides/view_engines/pug) or [**ejs**](https://nestjs-i18n.com/guides/view_engines/ejs))\n- Custom resolvers\n- Custom loaders\n- Custom formatters\n\n## Getting started\n\nTo get started follow the [**quickstart**](https://nestjs-i18n.com/quick-start), or take a look at the [**docs**](https://nestjs-i18n.com/). \n\n## License\n\n`nestjs-i18n` is MIT licensed.\n\n## Breaking changes:\n- from V10.0.0 on we removed the `I18nRequestScopeService`. This because we now have `async_hooks` support. This allows you to get the current `I18nContext` by doing `I18nContext.current()`.\n\n- from V9.0.0 on we renamed the `parser` property to `loader`. The `translate` function no longer returns a promise 🎉. A lot of new features and new docs, see [nestjs-i18n.com](https://nestjs-i18n.com/).\n\n- from V8.0.0 on we changed the internal `I18n-middleware` for an `interceptor` this way we can provide the `ExecutionContext` so that `nestjs-i18n` works on different protocols as well, such as gRPC and WebSockets. This contains one breaking change. It only applies to your code if you've made a custom `resolver`. To resolve this breaking change take a look at this [example](https://nestjs-i18n.com/concepts/resolver). Instead of providing the `req` in the `resolve` method, change this to take the `ExecutionContext` as argument.\n\n- from V6.0.0 on we implemented the `I18nParser`, by using this we can easily support different formats other than JSON. To migrate to this change look at the [quickstart](https://nestjs-i18n.com/quick-start). There are some changes in the declaration of the `I18nModule`. Note: the `translate` function returns a `Promise\u003cstring\u003e`. So you need to call it using `await i18n.translate('HELLO')`;\n\n- from V4.0.0 on we changed the signature of the `translate` function, the `language` is now optional, if no `language` is given it'll fallback to the `fallbackLanguage`.\n\n- from V3.0.0 on we load translations based on their directory name instead of file name. Change your translations files to the structure found in the [quickstart](https://nestjs-i18n.com/quick-start#setup-translation-files).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToonvanStrijp%2Fnestjs-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FToonvanStrijp%2Fnestjs-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToonvanStrijp%2Fnestjs-i18n/lists"}