diff --git a/curriculum/getChallenges.js b/curriculum/getChallenges.js index 154ed1e8c8d..d558dc6e0a4 100644 --- a/curriculum/getChallenges.js +++ b/curriculum/getChallenges.js @@ -34,9 +34,7 @@ const COMMENT_TRANSLATIONS = createCommentMap( function createCommentMap(dictionariesDir) { // get all the languages for which there are dictionaries. - const languages = fs - .readdirSync(dictionariesDir) - .filter(x => x !== 'english'); + const languages = fs.readdirSync(dictionariesDir); // get all their dictionaries const dictionaries = languages.reduce( @@ -363,18 +361,18 @@ Challenges that have been already audited cannot fall back to their English vers await validate(filePath, meta.superBlock); - const useEnglish = - lang === 'english' || - !isAuditedCert(lang, meta.superBlock) || - !fs.existsSync(getFullPath(lang, filePath)); + // We always try to translate comments (even English ones) to confirm that translations exist. + const translateComments = + isAuditedCert(lang, meta.superBlock) && + fs.existsSync(getFullPath(lang, filePath)); - const challenge = await (useEnglish - ? parseMD(getFullPath('english', filePath)) - : parseTranslation( + const challenge = await (translateComments + ? parseTranslation( getFullPath(lang, filePath), COMMENT_TRANSLATIONS, lang - )); + ) + : parseMD(getFullPath('english', filePath))); addMetaToChallenge(challenge, meta);