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

@@ -15,17 +15,19 @@ exports.translateComments = (text, lang, dict, codeLang) => {
}
};
exports.translateCommentsInChallenge = (challenge, lang, dict, codeLang) => {
exports.translateCommentsInChallenge = (challenge, lang, dict) => {
const challClone = clone(challenge);
if (challClone.files[0] && challClone.files[0].contents) {
challClone.files[0].contents = this.translateComments(
challenge.files[0].contents,
lang,
dict,
codeLang
);
}
Object.keys(challClone.files).forEach(key => {
if (challClone.files[key].contents) {
challClone.files[key].contents = this.translateComments(
challenge.files[key].contents,
lang,
dict,
challClone.files[key].ext
);
}
});
return challClone;
};