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.
pull/1673/head
Eskild Hustvedt 2022-04-08 16:50:41 +02:00
parent dc273a7a12
commit adb053ef1c
1 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,9 @@
outputs a list of strings that have been found. outputs a list of strings that have been found.
See https://github.com/espruino/BangleApps/issues/1311 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; let translate = false;
@ -234,6 +237,11 @@ for (let language of languages) {
translations.GLOBAL[translationItem.str] = translation; translations.GLOBAL[translationItem.str] = translation;
resolve() resolve()
})) }))
} else if(process.env.AUTOREFRESH && !translate) {
translationPromises.push(new Promise(async (resolve) => {
translations.GLOBAL[translationItem.str] = translationItem.str;
resolve()
}))
} }
} }
}); });