loopback-i18n

i18n middleware for loopback

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
loopback-i18n
711.1.46 years ago6 years agoMinified + gzip package size for loopback-i18n in KB

Readme

Loopback i18n middleware
!Travis-CItravis-badgetravis-url
This is a simple middleware using mashpie/i18n package. By default is set to accept en locale and use the folder common/i18n.
Author: Roger Fos Soler (desaroger23@gmail.com)

Usage

First, install the library:
$ npm i --save loopback-i18n

Add the middleware to your middleware.json:
{
	"initial": {
		"loopback-i18n#i18n": {}
	}
}

Or you can use it throw code:
let loopbackI18n = require('loopback-i18n');
app.middleware('initial', loopbackI18n());

Options

The options are passed directly to the mashpie package. You can see all available options here. We define this default options object:
{
	"directory": "common/i18n",
	"locales": ["en"]
}