i18n-t

1.0.1 • Public • Published

i18n-t

Easy to use i18n utility. It does not contain express specific middlewares, etc.

Build Status NPM version

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);

Readme

Keywords

none

Package Sidebar

Install

npm i i18n-t

Weekly Downloads

3,114

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • samypesse