1.1.4 • Published 2 years ago

pluto-i18n v1.1.4

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

pluto-i18n

This package is a tool to ease the way of adding texts to language's .json

Install

npm i -D pluto-i18n

Add this script to your package.json

"pi18n": "node node_modules/pluto-i18n/index.js"

Then create a .json file for every language you want to add. Each one of them needs to have an object, doesn't matter if it's empty. You can locate these files wherever you prefer.

Usage

By CLI

npm run pi18n {action} {language_json_path} {key} {text}

By JSON

First you have to create an "addText.json" at the root folder, it has to look like this

[{ "path": "language_json_path", "key": "key", "text": "text" }]

Then you have to run npm run pi18n json

Actions

Optional path shortener

You can put an addTextPaths.json in the root folder to abbreviate the paths, this is useful when using the CLI, as you don't have to put the full path

{
    "es": "src/lib/i18n/languages/spanish.json",
    "en": "src/lib/i18n/languages/english.json",
    "pr": "src/lib/i18n/languages/portuguese.json"
}

Then you can do:

npm run pi18n add es hello hola

or in the addText.json

      { "path": "es", "key": "hello", "text": "hola"
      { "path": "en", "key": "hello", "text": "hello" }
   ]
1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago