From c9bbc0ce5a9143757c256fe176b085d9b20f5cc0 Mon Sep 17 00:00:00 2001 From: Matteias Collet Date: Sun, 16 Aug 2020 07:22:48 +0200 Subject: [PATCH] Update Codes.xml --- scripts/compare_translations.js | 6 +++++- scripts/inject_codes.js | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/compare_translations.js b/scripts/compare_translations.js index 2a82c11..887a47a 100644 --- a/scripts/compare_translations.js +++ b/scripts/compare_translations.js @@ -50,7 +50,11 @@ translations.forEach((t) => { leavePaths.forEach((p) => { const value = getNestedProperty(t.values, p); - if (value == null || typeof value !== 'string') + if (value == null || typeof value !== 'string') { console.warn(`${t.lang} is missing a translation at '${p}'`); + console.warn( + `::warning file=compare_translations.js,line=55,col=6::${t.lang} is missing a translation at '${p}'`, + ); + } }); }); diff --git a/scripts/inject_codes.js b/scripts/inject_codes.js index 1e947ad..b697850 100644 --- a/scripts/inject_codes.js +++ b/scripts/inject_codes.js @@ -103,6 +103,9 @@ const validateXML = (xmlString) => { console.warn( `Missing title translation for code '${codeTitle.textContent}' and locale ${localeIdentifiers[j]}`, ); + console.warn( + `::warning file=inject_codes.js,line=107,col=10::Missing title translation for code '${codeTitle.textContent}' and locale ${localeIdentifiers[j]}`, + ); } if (codes[i].querySelectorAll(`title[lang='${localeIdentifiers[j]}']`).length > 1) { @@ -115,6 +118,9 @@ const validateXML = (xmlString) => { console.warn( `Missing description translation for code '${codeTitle.textContent}' and locale ${localeIdentifiers[j]}`, ); + console.warn( + `::warning file=inject_codes.js,line=122,col=10::Missing description translation for code '${codeTitle.textContent}' and locale ${localeIdentifiers[j]}`, + ); } if (codes[i].querySelectorAll(`description[lang='${localeIdentifiers[j]}']`).length > 1) { @@ -126,10 +132,14 @@ const validateXML = (xmlString) => { // All sources have a unique valid version attribute for (let j = 0; j < CODE_VERSIONS.length; j++) { - if (codes[i].querySelectorAll(`source[version='${CODE_VERSIONS[j]}']`).length === 0) + if (codes[i].querySelectorAll(`source[version='${CODE_VERSIONS[j]}']`).length === 0) { console.warn( `Missing source on code '${codeTitle.textContent}' for version ${CODE_VERSIONS[j]}`, ); + console.warn( + `::warning file=inject_codes.js,line=140,col=10::Missing source on code '${codeTitle.textContent}' for version ${CODE_VERSIONS[j]}`, + ); + } if (codes[i].querySelectorAll(`source[version='${CODE_VERSIONS[j]}']`).length > 1) throw new Error( @@ -158,6 +168,9 @@ const readTextNode = (node, identifier, lang = null, fallbackLang = null) => { const codeTitle = node.querySelector(`title[lang='en-US']`); console.warn(`No translation found for code '${codeTitle.textContent}' for locale ${lang}`); + console.warn( + `::warning file=inject_codes.js,line=172,col=6::No translation found for code '${codeTitle.textContent}' for locale ${lang}`, + ); if (!fallbackLang) throw new Error(`No localized ${identifier} found on ${node.textContent}`); const fallbackElement = node.querySelector(`${identifier}[lang='${fallbackLang}']`);