translations-generator
v1.4.3
Published
translations-generator generates translations with label and text for json and js files.
Downloads
6
Maintainers
Readme
Installation
Install package using npm or yarn.
npm install translations-generator --save-dev
or
yarn add translations-generator -D
Add
translations.config.json
file to root of your directory.{ ext: "js", // "ts", "js" or "json" (extention of translations), path: "src/translations", // path to folder with translations pattern: "translatations_", // (optional) specify pattern to use "en" instead of "translatations_en" alias: { "en": "translatations_en", // (optional) you can use "en" to specify translation } }
Usage
Run command for adding translation to files
translations-generator
Run command for removing translation from files
translations-generator --remove-label
Example
.
├── src
│ ├──translations
│ ├── translation_en.js
│ ├── translation_de.js
│ ├── translation_nl.js
│ │...
│ ├──components
│ ├──....
├── README.md
├── translations.config.json
│...
// translation_en.js
export default {
"title": "Title",
};
Run translations-generator
You'll see
Enter translations you want to use: (empty is all)
Enter a label: description
Enter a text: Description
Output
// translation_en.js
export default {
"title": "Title",
"description": "Description",
};
Generated files are ready! 🎉
CONTRIBUTING
Feel free contribute to the project. More information you can find in CONTRIBUTING file.
License
MIT – See LICENSE file.