@narando/express-read-language-from-user
v0.36.0
Published
A middleware to set the language wich will be used by `i18next`.
Downloads
19
Readme
@narando/express-read-language-from-user
A middleware to set the language wich will be used by i18next
.
Getting Started
You need to have nodejs
, npm
, express
and 18next
installed.
$ npm install @narando/express-read-language-from-user
Usage
The middleware will use languages from the user object at req
and has the i18next
language as fallback:
import changeUILanguage from "@narando/express-read-language-from-user";
// add middleware to express
app.router(changeUILanguage());
You should use this in combination with @narando/express-i18n-middleware
and @narando/preferred-ui-language