From: Laurent Mazet Date: Sat, 23 May 2020 20:31:30 +0000 (+0200) Subject: add some comments to explain the need of language translating after the parsing X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=aac7753bd41202c4b5e026789d642278050fe724;p=trivabble.git add some comments to explain the need of language translating after the parsing --- diff --git a/l10n/make_board.js b/l10n/make_board.js index 3d63430..b8eb3b3 100755 --- a/l10n/make_board.js +++ b/l10n/make_board.js @@ -10,10 +10,12 @@ const ROOT = process.env.ROOT_BOARD || "."; const fs = require("fs"); const path = require("path"); +/* The French wikipedia page is easier to parse */ +const htmlText = fs.readFileSync("Lettres_du_Scrabble", {encoding: "utf-8"}); + +/* Table used to translate language name from French to English */ const code = require(path.join(__dirname, "languageCodes.json")); // eslint-disable-line global-require -const htmlText = fs.readFileSync("Lettres_du_Scrabble", {encoding: "utf-8"}); - let lang; let key; let bag = ""; @@ -52,6 +54,9 @@ for (const line of htmlText.split("\n")) { /* Get language name */ const regexpLang = /mw-headline"[^<]*">(?[^<]*)