@aliakbar_alkaf/language
v1.0.1
Published
Translates multiple languages using longest prefix match algorithm
Downloads
3
Readme
Language
Translates multiple languages using longest prefix match algorithm
Installation
npm install
Usage
// Language setting is not required for single language pair
var Language = require('@aliakbar_alkaf/language')('en', 'id');
Language.setTranslation('hi from there', 'halo dari sana');
// returns 'halo dari here'
console.log(Language.translate('hi from here'));
// returns ['here', 'hi from here.']
console.log(Language.getEmptyTranslations());