fabrica

CLI bulk string substitution / i18n utility for static HTML

npm install fabrica
6 downloads in the last week
12 downloads in the last month

We sent you all those translations in an Excel spreadsheet

You can just copy & paste them into the HTML, right? Otherwise you can make your spreadsheet look like this:

filename Original string 1 Original string 2 Original string 3 ...
translation_lang_1.html Replacement string 1 Replacement string 2 Replacement string 3 ...
translation_lang_2.html Replacement string 4 Replacement string 5 Replacement string 6 ...
... ... ... ... ...

And export it to CSV. Then you can do:

npm install -g fabrica
fabrica -t path/to/original.html -s path/to/substitutions.csv

You'll get out n files with the specified substitutions.

Note:

You might want to wrap the placeholders in your original HTML and substitutions CSV {{ somehow }} otherwise you may run into issues with partial matches.

npm loves you