0.0.2 • Published 2 years ago

universal-language v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Universal language use

Install

  • NPM = npm i universal-language

Github

INFO

  • Once you select a folder, you need to make a .json file in that folder. Then you can continue working.

Ussage

  • index.js
const plugin = require("./src/main.js")
const Client  = new plugin({
    folder: "./lang"
})
console.log(Client.say("welcome", "cz"))
console.log(Client.say("welcome", "en"))
console.log(Client.say("weather.cold", "cz"))
console.log(Client.say("weather.cold", "en"))
  • /lang/cz.json
{
    "welcome": "Ahoj!!",
    "weather": {
        "cold": "Zima",
        "warm": "Teplo"
    }
}
  • /lang/en.json
{
    "welcome": "Hello!!",
    "weather": {
        "cold": "Cold",
        "warm": "Warm"
    }
}