i18n-t
v1.0.1
Published
Very easy to use and dumb i18n utility
Downloads
20,733
Readme
i18n-t
Easy to use i18n utility. It does not contain express specific middlewares, etc.
var I18n = require('i18n-t');
var i18n = new I18n({
defaultLocale: 'en'
});
// Load locales from a directory
i18n.load('./locales');
// or using a pre-loaded objects
i18n.set({
en: {
HELLO: 'Hello {{name}}',
CATS: '{{0}} cats'
}
});
// Translate sentences
i18n.t('en', 'HELLO', { name: 'Samy' });
i18n.t('en', 'CATS', 10);