node-localizer

0.3.1 • Public • Published

node-localizer

Installation

Npm

npm install node-localizer

Yarn

yarn add node-localizer

Support

This library is quite fresh, and maybe has bugs. Write me an email to natashkinsash@gmail.com and I will fix the bug in a few working days.

Quick start

const Localizer = require('node-localizer');

const localizer = new Localizer({TEST: {en: "test", ru: "тест", cz: "kvíz"}}, {locale: 'en', default: 'en'});

let test = localizer.get({key: 'TEST'}); // { text: "test", locale: "en" }

localizer.setLocal('cz');

test = localizer.get({key: 'TEST'}); // { text: "kvíz", locale: "cz" }

test = localizer.get({key: 'TEST', local: 'ru'}); // { text: "тест", locale: "ru" }

/node-localizer/

    Package Sidebar

    Install

    npm i node-localizer

    Weekly Downloads

    6

    Version

    0.3.1

    License

    ISC

    Unpacked Size

    12.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • natashkinsasha