From 8d1aea5b2ec5fb542282baa1daa76b6795f1ce0d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 23 Oct 2017 10:18:29 +0100 Subject: [PATCH] Misc PR review fixes --- scripts/gen-i18n.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/gen-i18n.js b/scripts/gen-i18n.js index 56f64d2154..ff5b14f593 100755 --- a/scripts/gen-i18n.js +++ b/scripts/gen-i18n.js @@ -85,7 +85,7 @@ function getFormatStrings(str) { const formatStrings = new Set(); let match; - while ( (match = formatStringRe.exec(str)) !== null) { + while ( (match = formatStringRe.exec(str) ) !== null) { const placeholder = match[1]; // Minus the leading '%' if (placeholder === '%') continue; // Literal % is %% @@ -96,14 +96,14 @@ function getFormatStrings(str) { if (placeholderMatch.length < 3) { throw new Error("Malformed format specifier"); } - const placeHolderName = placeholderMatch[1]; - const placeHolderFormat = placeholderMatch[2]; + const placeholderName = placeholderMatch[1]; + const placeholderFormat = placeholderMatch[2]; - if (placeHolderFormat !== 's') { - throw new Error(`'${placeHolderFormat}' used as format character: you probably didn't mean this`); + if (placeholderFormat !== 's') { + throw new Error(`'${placeholderFormat}' used as format character: you probably meant 's'`); } - formatStrings.add(placeHolderName); + formatStrings.add(placeholderName); } return formatStrings; @@ -142,7 +142,6 @@ function getTranslationsJs(file) { } catch (e) { console.log(); console.error(`ERROR: ${file}:${node.loc.start.line} ${tKey}`); - console.error(e); process.exit(1); } }