Translate a lot of texts tempered with markup is an error prune task. This script is intended to assure the tags and structure are not compromised.
-
NodeJS required version > 14
-
Install dependecies:
npm install
-
Download csv from zoho and move than to this directory.
-
Run
node cli.js #run against all langs node cli.js --pt #for pt lang only
To run the tests:
npm run test
Two validations is run against the CSVs.
- Check for Empties
./eSailData_LocaleAlerts.csv
┌line 93 2=Alert Header
├en Apparent Wind
└it <empty>
Read: At sheet LocaleAlerts, line 93, the english column 2=Alert Header
has no corresponding italian (it) translation.
- Markup Matcher
Checks if the tags on the en column matches the tags on other language column.
./eSailData_LocaleAlerts.csv
┌line 33 3=Alert Text \n\n ° <flink=000></fLink>
├en [ '<i>', '</I>', '<Rebind_Autopilot>' ]
└it [ '<i>', '<Rebind_Autopilot>' ]
Read: At sheet LocaleAlerts, line 33, the english column 3=Alert Text \n\n ° <flink=000></fLink>
has a problem with the markup tags in the corresponding italian (it) column. In this example, the problem is: no closing </I>
.