pipe-translator
v0.0.26
Published
The pipe-translator is a React.js app with an express server that reads i18n.json files from a project and visualizes their content. It therefore makes it possible for you to view and edit translation messages for each module in your project.
Downloads
11
Readme
pipe-translator
The pipe-translator is a React.js app with an express server that reads i18n.json files from a project and visualizes their content. It therefore makes it possible for you to view and edit translation messages for each module in your project.
Installation
- Run
$ npm install pipe-translator
in your project directory - Add
"translate": "pipe-translator start",
to the "scripts" in your package.json
Usage
- Run
$ npm run translate
in your project directory - Open your browser on localhost:6001 and you can start editing the module translations
- In your project each i18n.json file needs to have following structure for the pipe-translator to work
{
"name": "Module name",
"description": "Discribe your module",
"i18n": [
{
"id": "Hello string",
"description": "Discribe your string",
"length": "250",
"message": {
"en-us": "Hello {World}",
"de-de": "Hallo {Welt}"
}
}
]
}
Development
- Install your local pipe-translator with running
$ npm install path/to/your/pipe-translator
in your test project - Add
"translate": "pipe-translator start",
to the "scripts" in the package.json of your test project. The server will now be started and sources its 18nfiles from your test project. When making server updates rerun this command. - Run
$ npm run start
in your local pipe-translator to see your development changes of the react app. - Update the react app in the src folder
- Update the version number in package.json and bin/pipe-translator.js
- Run
$ npm run build
- Copy /build folder inside /static
- Publish the repository directory on npm