@mundophrase/cli v1.2.4
@mundophrase/cli
Manage MundoPhrase from the command-line.
Installation
Install @mundophrase/cli through npm:
$ npm install --save-dev @mundophrase/cliUsage
The mundophrase command is available from the command-line:
$ mundophrase --helpGlobal options
A few global options are available to all commands, these are:
a,api-key,apiKey
The API Key for your Project on MundoPhrase. Please keep this value safe, it is highly discouraged to store this value in version-control.
It is also possible to specify this value through the MUNDOPHRASE_API_KEY
environment variable.
Commands
get
Get a list of localization for a specified language, in a specified format. The result of this command will save the result to file.
Options
f,format
The file format to be saved. Valid options are android, ios, java, json,
net and net_txt. Default json. The format chosen will determine the
extension(s) of the saved file(s).
| format | extension |
|---|---|
android | .xml |
ios | .strings |
java | .properties |
json | .json |
net | .resx |
net_txt | .restxt |
l,language
The IETF language/locale code(s) to request and save to file, each language
requested this way will be saved to a file named {language}.{extension} where
extension can be found in the table above.
o,output-directory,outputDirectory
The directory in which to save the resulting file(s) relative to where the
script is being run. Valid directory name may begin with or without the trailing
./.
Example
$ mundophrase get -a APIKEY -f android -l af-ZA -l en-US -o src/i18nDevelopment
Environment
For convenience, a development environment is included in the form of a
Dockerfile and a docker-compose.yml file. To set it up you need to:
Copy the .env.sample file to .env and fill in the values (if required):
$ cp .env.sample .envBuild the container (app):
$ docker-compose buildTesting
All tests can be run with the command:
$ docker-compose run --rm app npm testor without Docker:
$ npm testIf you choose this option you will have to npm install locally first.
Linting
Linting is run through eslint with eslint-config-airbnb-base as configuration. To run the linter you can use:
$ docker-compose run --rm app npm run test:lintor without Docker:
$ npm run test:lintAuditing
Auditing is done through the npm audit command with some options applied. To run auditing with default options applied you can use the command:
$ docker-compose run --rm app npm run test:vulnerabilitiesor without Docker:
$ npm run test:vulnerabilitiesUnit tests
Unit tests are run through Jest. When adding new functionality, please add tests. To run the unit tests you can use the following command:
$ docker-compose run --rm app npm run test:scriptsor without Docker:
$ npm run test:scriptsReleasing
We use semantic-release to release @mundophrase/cli. Any merge to the
master branch will trigger a release automatically. Please read the the
semantic-release documentation to see how commit messages should be
formatted.