koa-i18n
I18n fro koa, based on i18n-2. NOTE: If want to use koa-i18n, koa-locale must be required!
koa-i18n version | branch | koa version |
---|---|---|
1.x latest | v1.x | 1.x latest |
2.x next | master | 2.x next |
Installation
$ npm install koa-i18n
Usage
const Koa = const convert = const locale = // detect the localeconst render = // swig renderconst i18n = const app = // Required! appcontextrender = app app app
Tip: We can change position of the elements in the
modes
array. If one mode is detected, no continue to detect.
Dependencies
- i18n-2
- koa-locale - Get locale variable from query, subdomain, accept-languages or cookie
License
MIT