fix(tools): update translation parser

Since we're adding more validation we can simplify the parser and
make sure it does catch all the comments.  Rather than worry about a
load of edge cases that do not appear in our challenges.
This commit is contained in:
Oliver Eyton-Williams
2020-09-28 15:13:18 +02:00
committed by Mrugesh Mohapatra
parent 793fa8fb52
commit 92a60f8bce
3 changed files with 63 additions and 39 deletions

View File

@ -201,12 +201,12 @@ async function parseTranslation(engPath, transPath, dict, lang) {
const engChal = await parseMarkdown(engPath);
const translatedChal = await parseMarkdown(transPath);
const engWithTranslatedComments = translateCommentsInChallenge(
engChal,
lang,
dict
);
// challengeType 11 is for video challenges, which have no seeds, so we skip
// them.
const engWithTranslatedComments =
engChal.challengeType !== 11
? translateCommentsInChallenge(engChal, lang, dict)
: engChal;
return mergeChallenges(engWithTranslatedComments, translatedChal);
}