fill in all empty values in all languageCaches. (#3606)

* fill in all empty values in all languageCaches.

* add semicolon

Co-authored-by: baghappening <baghappening@gmail.com>
This commit is contained in:
motinados 2020-09-04 17:38:33 +09:00 committed by GitHub
parent 34ca0ba375
commit efef6d32a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,11 +68,13 @@ async function retrieveAll (): Promise<Defaults> {
? await Promise.all(missing.map((lng) => retrieveJson(`${lng}/translation.json`)))
: [];
// setup the language cache
missing.forEach((lng, index): void => {
// setup the language cache
languageCache[lng] = translations[index] as Record<string, string>;
});
// fill in all empty values (useful for download, filling in)
// fill in all empty values (useful for download, filling in)
keys.forEach((lng):void => {
Object.keys(english).forEach((record): void => {
Object.keys(english[record]).forEach((key): void => {
if (!languageCache[lng][key]) {