open-i18n
v0.5.0
Published
i18n language locale && i18n.middleWare
Downloads
18
Readme
open-i18n
=================
Quick start
Usage
var i18n = require('i18n');
// languages System allow language
// locale Current request use lanuage
// language packages,
/*
{
"zh": {
"hello world": "你好世界。"
},
"en": {
"hello world": "Hello world."
}
}
*/
var t = i18n(languages, locale, LANGS).t;
t('hello world'); // return "你好世界"
// middle-ware auto handle res.body when request error
server.use(i18n.middleWare(languages, defaultLanguage, LANGS))
Collect language items
Translate language items
Edit en.po
, zh.po
to translate.