koa-languages
v1.0.1
Published
Internationalization
Downloads
7
Maintainers
Readme
Welcome to koa-languages
Browser Support
| | | | | | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Install Command:
npm install koa-languages --save
Use:
import Languages from 'koa-languages';
/* Simulated KOA Network Framework Routing,
* lang <en-US ru-RU zh-CN zh-TW>
*/
const lang = socket.request.header['accept-language'].split(',')[0]);
new Languages(lang, (socket) => {
socket.body = socket.hello;
})