@hizp/nestjs-i18n v9.2.2
Features
nestjs-i18n comes with a bunch of tools to help add multiple language support to your project.
- Variable formatting (instructions)
- Nested translations (instructions)
- Fallback languages (instructions)
- Live reloading 🎉
- Plurals support (instructions)
- GraphQL support (instructions)
- gRPC support (instructions)
- DTO validation (instructions)
- View engine support (hbs or pug or ejs)
- Custom resolvers
- Custom loaders
- Custom formatters
Getting started
To get started follow the quickstart, or take a look at the docs.
License
nestjs-i18n is MIT licensed.
Breaking changes:
- from V9.0.0 on we renamed the - parserproperty to- loader. The- translatefunction no longer returns a promise 🎉. A lot of new features and new docs, see nestjs-i18n.com.
- from V8.0.0 on we changed the internal - 18n-middlewarefor an- interceptorthis way we can provide the- ExecutionContextso that- nestjs-i18nworks 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. Instead of providing the- reqin the- resolvemethod, change this to take the- ExecutionContextas argument.
- 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. There are some changes in the declaration of the- I18nModule. Note: the- translatefunction returns a- Promise<string>. So you need to call it using- await i18n.translate('HELLO');
- from V4.0.0 on we changed the signature of the - translatefunction, the- languageis now optional, if no- languageis given it'll fallback to the- fallbackLanguage.
- 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. 
3 years ago