Skip to content

DragomanJS is a tool used to programmatically scrub your Symfony, Laravel, and Craft CMS templates outputting translatable strings into PHP, JSON, and CSV files.

License

Notifications You must be signed in to change notification settings

codewithkyle/dragomanjs

Repository files navigation

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:

npm i -D dragomanjs

Create a dragoman.config.js config file:

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:

"translate": "dragoman"

Run the NPM script:

npm run translate

About

DragomanJS is a tool used to programmatically scrub your Symfony, Laravel, and Craft CMS templates outputting translatable strings into PHP, JSON, and CSV files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published