https://github.com/codewithkyle/dragomanjs
DragomanJS is a tool used to programmatically scrub your Symfony, Laravel, and Craft CMS templates outputting translatable strings into PHP, JSON, and CSV files.
https://github.com/codewithkyle/dragomanjs
Last synced: 9 months ago
JSON representation
DragomanJS is a tool used to programmatically scrub your Symfony, Laravel, and Craft CMS templates outputting translatable strings into PHP, JSON, and CSV files.
- Host: GitHub
- URL: https://github.com/codewithkyle/dragomanjs
- Owner: codewithkyle
- License: mit
- Created: 2019-07-09T22:22:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T10:53:37.000Z (over 2 years ago)
- Last Synced: 2025-03-11T14:52:22.055Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/dragomanjs
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DragomanJS
> _drag·o·man_: an interpreter or guide
Dragoman is a tool used to programmatically scrub your Symfony, Laravel, or Craft CMS templates and outputs all translatable strings into a CSV file. Dragoman also provides the ability to convert a CSV file into PHP and JSON files.
## Installation
Install the package from NPM:
```bash
npm i -D dragomanjs
```
Create a `dragoman.config.js` config file:
```javascript
module.exports = {
syntax: "twig", // currently supports 'twig'
lang: ["es-MX", "jp-JA", "ca-FR", "ko-KR"], // must be an array of strings
content: "./templates", // can be an array of template directories
output: "./translations",
};
```
Setup an NPM script to run the CLI:
```json
"translate": "dragoman"
```
Run the NPM script:
```bash
npm run translate
```