From 2340c1308eff852c6b948f37dc7457094db6137e Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 23 Oct 2017 19:53:17 +0100 Subject: [PATCH 1/2] Fix bug with gen-i18n/js when adding new plurals --- scripts/gen-i18n.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/gen-i18n.js b/scripts/gen-i18n.js index 609c6b00c5..cbef54ba9c 100755 --- a/scripts/gen-i18n.js +++ b/scripts/gen-i18n.js @@ -177,7 +177,9 @@ const trObj = {}; for (const tr of translatables) { trObj[tr] = tr; if (tr.includes("|")) { - trObj[tr] = inputTranslationsRaw[tr]; + if (inputTranslationsRaw[tr]) { + trObj[tr] = inputTranslationsRaw[tr]; + } } } From 46e9d4197a621b7a735040913544977167bf8672 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 24 Oct 2017 10:21:41 +0100 Subject: [PATCH 2/2] Use the 'and' feature! --- scripts/gen-i18n.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/gen-i18n.js b/scripts/gen-i18n.js index cbef54ba9c..670089ba63 100755 --- a/scripts/gen-i18n.js +++ b/scripts/gen-i18n.js @@ -176,10 +176,8 @@ for (const path of SEARCH_PATHS) { const trObj = {}; for (const tr of translatables) { trObj[tr] = tr; - if (tr.includes("|")) { - if (inputTranslationsRaw[tr]) { - trObj[tr] = inputTranslationsRaw[tr]; - } + if (tr.includes("|") && inputTranslationsRaw[tr]) { + trObj[tr] = inputTranslationsRaw[tr]; } }