better-translate
v1.0.1
Published
Better way for i18n
Downloads
4
Readme
better-translate-parser
Install
$ npm i -g better-translate
Config
Create the configuration better-translate.json
file in the root of the project to be parsed. This file is required.
| attributes | Type/value | Required | Default | Description | |-----------------|:-----------:|:--------:|:-----------:|:-----------------------------------:| | path | String | false | process PWD | | | pwd | String | false | process PWD | | | parsers | Array | false | | | | appName | String | true | | |
####Example { "path": "/src", "pwd": "/Users/me/projects/myApp", "parsers": [ "i18n-react", "i18n" ], "extensions": [ ".jsx", ".pug" ], "appName": "myApp", "hostmame": "http://mybettertranslate.com" }
In this case better-translate will parse the folder /Users/me/projects/myApp/src
##Use
From the root of your project, you just need to run the following commands:
###Parse
Parse your project and submit variables to BetterTranslate app.
myApp $ better-translate
Watch
Makes an complete parse of your projet and after, watch update and submit its to BetterTranslate app.
myApp $ better-translate -w
Add
Add directly new variable(s) to BetterTranslate app.
Single
myApp $ better-translate -a hello
Many
myApp $ better-translate -a hello,world,how_are_you