This project makes use of the nest-i18n library. It shows you how to implement i18n functionallity in your project.
To start the project run
npm run start:dev
For the purpose of this demo I implemented 3 routes.
http://localhost:3000/hellohttp://localhost:3000/goodbyehttp://localhost:3000/:lang/path
This demo implements 3 different types over resolvers.
PathResolver(custom) this resolves the language based on the url.http://localhost:3000/nl/pathorhttp://localhost:3000/en/pathQueryResolverThis resolver tries to collect the data based on the query parameters. This is usefull so that you can easily override the language of the response you want.http://localhost:3000/hello?lang=enorhttp://localhost:3000/hello?lang=nlAcceptLanguageResolverThis resolver grabs the language based on theaccept-languageheader. (language of you browser)