parrot-translate-cli v0.1.5
Parrot CLI
This module is a CLI tool for any parrot backend.
I made this because I needed specific actions, if you need any other, please feel free to open an issue, or even an PR :)
Installation
Simply install the package globally :
$ npm install --global parrot-translate-cli
$ yarn global add parrot-translate-cliYou will be able to use the following command parrot-cli.
Usage
Display help
Simply enter the command without any action
$ parrot-cliIt will display the help :
Usage: parrot [options] [command]
Commands:
login|l Login to the parrot backend
logout Logout of the parrot backend
info|i Info about the user
import-keys|ik Import keys to project
import-locale-keys|ilk Import keys to locale for a project
help [cmd] display help for [cmd]
This is the parrot CLI
Options:
-h, --help output usage information
-V, --version output the version numberActions
You first need need to login using the login action
$ parrot-cli loginYou will be asked for your parrot backend address (something like https://localhost when testing locally), email and password.
You can then check your information using the info command :
$ parrot-cli infoIt will display something like this :
info: Host https://localhost
info: Email your@email.comYou can then start the other actions :
import-keys: This action imports keys to a specific project. It requires the-foption with a path to the JSON file. It will prompt for the projectimport-locale-keys: This action imports translations for a specific locale to a specific project. It requires the-foption with a path to the JSON file. It will prompt for the project and then the locale
Format
For the moment, the imports for keys and strings support i18next format:
{
"key": "value",
"keyDeep": {
"inner": "value"
},
...
}It will then work on flat JSON
License
MIT