fix(tools): update parser for multi-file editor

This commit is contained in:
Oliver Eyton-Williams
2020-09-09 18:08:38 +02:00
committed by Mrugesh Mohapatra
parent a500279036
commit 7bed07ee8a
2 changed files with 16 additions and 19 deletions

View File

@ -113,17 +113,12 @@ async function buildCurriculum(file, curriculum) {
async function parseTranslation(engPath, transPath, dict) {
const engChal = await parseMarkdown(engPath);
const translatedChal = await parseMarkdown(transPath);
const codeLang =
engChal.files && engChal.files[0] ? engChal.files[0].ext : null;
const engWithTranslatedComments = codeLang
? translateCommentsInChallenge(
engChal,
getChallengeLang(transPath),
dict,
codeLang
)
: engChal;
const engWithTranslatedComments = translateCommentsInChallenge(
engChal,
getChallengeLang(transPath),
dict
);
return mergeChallenges(engWithTranslatedComments, translatedChal);
}