Giter VIP home page Giter VIP logo

nestjs-i18n's Introduction

nestjs-i18n Logo

The i18n library for nestjs. 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.

npm version NPM npm downloads coverage

Features

nestjs-i18n comes with a bunch of tools to help add multiple language support to your project.

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 parser property to loader. The translate function 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-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. Instead of providing the req in the resolve method, change this to take the ExecutionContext as 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 translate function 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 translate function, the language is now optional, if no language is 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.