multilang-label-manager

0.3.0 • Public • Published

Installation

npm i multilang-label-manager

Usage

Create a global variable that you can use throughout the project. You must pass the request of the server as a parameter.

global.LabelManager = require("multilang-label-manager")(request);

Now you can adding your languages using the addLanguages(args) command, and add new labels using the addLabels(args) command.

global.LabelManager.addLanguages("cn", "es", "it");
global.LabelManager.addLabels({
    "cn": {
        "welcome": "欢迎"
    },
    "es": {
        "welcome": "bienvenida"
    },
    "it": {
        "welcome": "benvenuto"
    }
});

The defalt language is en to set new language as default use the command:

global.LabelManager.setDefaultLang("es");

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i multilang-label-manager

      Weekly Downloads

      1

      Version

      0.3.0

      License

      ISC

      Unpacked Size

      3.37 kB

      Total Files

      5

      Last publish

      Collaborators

      • fab95s