From b0aaff19dc169bce26621b0ea29cefb5c4b6766f Mon Sep 17 00:00:00 2001 From: "Nicholas Carrigan (he/him)" Date: Fri, 8 Jan 2021 08:39:28 -0800 Subject: [PATCH] fix(tools): Validate server-side keys (#40643) Adds the `api-server` code to the key validation script to include keys that are specifically used on the server-side only. Signed-off-by: nhcarrigan --- client/i18n/validate-keys.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/i18n/validate-keys.js b/client/i18n/validate-keys.js index b162ee3a0c..b2899f9ccd 100644 --- a/client/i18n/validate-keys.js +++ b/client/i18n/validate-keys.js @@ -54,9 +54,12 @@ const readComponentCode = filePath => { }; const clientCodebase = readComponentCode(path.join(process.cwd() + '/src')); +const serverCodebase = readComponentCode( + path.join(process.cwd() + '/../api-server/server') +); for (const key of keyStrings) { - if (!clientCodebase.includes(key)) { + if (!clientCodebase.includes(key) && !serverCodebase.includes(key)) { console.warn(`The translation key '${key}' appears to be unused.`); } }