From cbdf317aae1875d0e23f807796cd6fabf512c0e8 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 16 Mar 2021 16:22:39 +0100 Subject: [PATCH] fix: suppress warning for seedless challenges (#41507) Both challengeType 11 and challengeType 3 have no seeds, so there's no need to warn about a lack of seed. The warning has been updated to better reflect the problem (lack of seed, not lack of comments) --- curriculum/getChallenges.js | 7 ++++--- tools/challenge-parser/translation-parser/index.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/curriculum/getChallenges.js b/curriculum/getChallenges.js index d5a07c6f415..542ba527ec0 100644 --- a/curriculum/getChallenges.js +++ b/curriculum/getChallenges.js @@ -228,9 +228,10 @@ async function buildChallenges({ path }, curriculum, lang) { async function parseTranslation(transPath, dict, lang, parse = parseMD) { const translatedChal = await parse(transPath); - // challengeType 11 is for video challenges, which have no seeds, so we skip - // them. - return translatedChal.challengeType !== 11 + const { challengeType } = translatedChal; + // challengeType 11 is for video challenges and 3 is for front-end projects + // neither of which have seeds. + return challengeType !== 11 && challengeType !== 3 ? translateCommentsInChallenge(translatedChal, lang, dict) : translatedChal; } diff --git a/tools/challenge-parser/translation-parser/index.js b/tools/challenge-parser/translation-parser/index.js index 69e28072764..a3dc49a8189 100644 --- a/tools/challenge-parser/translation-parser/index.js +++ b/tools/challenge-parser/translation-parser/index.js @@ -17,7 +17,7 @@ exports.translateComments = (text, lang, dict, codeLang) => { exports.translateCommentsInChallenge = (challenge, lang, dict) => { const challClone = cloneDeep(challenge); if (!challClone.files) { - console.warn(`Challenge ${challClone.title} has no comments to translate`); + console.warn(`Challenge ${challClone.title} has no seed to translate`); } else { Object.keys(challClone.files).forEach(key => { if (challClone.files[key].contents) {