refactor: tidy up translation-parser

This commit is contained in:
Oliver Eyton-Williams
2021-02-03 10:46:27 +01:00
committed by Mrugesh Mohapatra
parent 9ff3a29a72
commit 73c06a5d71
3 changed files with 4 additions and 5 deletions

View File

@ -8,7 +8,7 @@ const util = require('util');
/* eslint-disable max-len */
const {
translateCommentsInChallenge
} = require('../tools/challenge-parser/translation-parser/translation-parser');
} = require('../tools/challenge-parser/translation-parser');
/* eslint-enable max-len*/
const { isAuditedCert } = require('../utils/is-audited');

View File

@ -1,5 +1,4 @@
const { isEmpty } = require('lodash');
const clone = require('lodash/cloneDeep');
const { isEmpty, cloneDeep } = require('lodash');
exports.translateComments = (text, lang, dict, codeLang) => {
const knownComments = Object.keys(dict);
@ -16,7 +15,7 @@ exports.translateComments = (text, lang, dict, codeLang) => {
};
exports.translateCommentsInChallenge = (challenge, lang, dict) => {
const challClone = clone(challenge);
const challClone = cloneDeep(challenge);
if (!challClone.files) {
console.warn(`Challenge ${challClone.title} has no comments to translate`);
} else {

View File

@ -3,7 +3,7 @@ const {
mergeChallenges,
translateComments,
translateCommentsInChallenge
} = require('./translation-parser');
} = require('.');
const {
ENGLISH_CERTIFICATE,
ENGLISH_CHALLENGE,