2.0.1 • Published 2 years ago

jr-translate v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Translate module (Internationalization)

translate key to lang value, using multiple language format

##how to use:

    translate(<lang, ...optional>, <groupPath>, <data, ...optional>) - default usage

    addPlural(<PluData>) - register new plural formatter

    addBlock(<BlockData>) - register new block with translates

    getLang(); - return [string] of current language

    setLang(<string>) - set new language for translates

    getNumber(<number>) - return number in locale format

samples:

 import {translate, getNumber, getLang, setLang} from 'jr-translate';

 const text = translate('group.key'); // default usage

 const numberLocale = getNumber(number); // return number in locale format

 const currLang = getLang(); // current lang

 setLang(newLang); // set new language for translates

 const text = translate('group.key', {
    dataKey: 'value'
 }); // with data pass

adding new langs

 import {addBlock} from 'jr-translate'; // module not binded to context
 import exampleBlock from './example.langs.ts';

 addBlock(exampleBlock); // make new langs for translates

licence: MIT, dudiq 2022

2.0.1

2 years ago

2.0.0

2 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago