From adb053ef1cb0154fd10f3696915e3a14d97ea5bd Mon Sep 17 00:00:00 2001 From: Eskild Hustvedt Date: Fri, 8 Apr 2022 16:50:41 +0200 Subject: [PATCH] Let language_scan optionally add stubbed translations This lets it refresh existing languages with the latest strings, without using the auto-translate feature. The strings will all simply be the English equivalent. --- bin/language_scan.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/language_scan.js b/bin/language_scan.js index 6385caf49..26ee77024 100755 --- a/bin/language_scan.js +++ b/bin/language_scan.js @@ -3,6 +3,9 @@ outputs a list of strings that have been found. See https://github.com/espruino/BangleApps/issues/1311 + +If you want to auto-add new string (with *only english text*), set the +environment variable AUTOREFRESH. */ let translate = false; @@ -234,6 +237,11 @@ for (let language of languages) { translations.GLOBAL[translationItem.str] = translation; resolve() })) + } else if(process.env.AUTOREFRESH && !translate) { + translationPromises.push(new Promise(async (resolve) => { + translations.GLOBAL[translationItem.str] = translationItem.str; + resolve() + })) } } });