1.1.4 • Published 7 years ago

loopback-i18n v1.1.4

Weekly downloads
47
License
MIT
Repository
github
Last release
7 years ago

Loopback i18n middleware

Travis-CI

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"]
}