From 148392d49a8c7c32b77f0a68c43a6d8ec296a730 Mon Sep 17 00:00:00 2001 From: Mayesters Date: Mon, 12 Jun 2017 21:18:20 +0200 Subject: [PATCH] update script again --- ui/extractLocals.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/ui/extractLocals.js b/ui/extractLocals.js index aa0de1eb3..f67d123e2 100644 --- a/ui/extractLocals.js +++ b/ui/extractLocals.js @@ -15,8 +15,6 @@ fs.writeFile(path, '{}', 'utf8', function(err) { let reports = []; reports = reports.concat(extract.findMissing(enLocale, keys)); - reports = reports.concat(extract.findUnused(enLocale, keys)); - reports = reports.concat(extract.findDuplicated(enLocale, keys)); if (reports.length > 0) { fs.readFile(path, 'utf8', function readFileCallback(err, data){ @@ -26,24 +24,16 @@ fs.writeFile(path, '{}', 'utf8', function(err) { localeObj = JSON.parse(data); for (var i = 0; i < reports.length; i++) { + // no need to care for other types than MISSING because starting file will always be empty if (reports[i].type === 'MISSING') { localeObj[reports[i].key] = reports[i].key; - } else if (reports[i].type === 'UNUSED') { - console.log("Found unused String in en.json, but beware: This may be a String from api.lbry.io, do not blindly delete!") - console.log(reports[i]); - } else if (reports[i].type == "DUPLICATED") { - console.log("Found duplicated String in en.json!") - console.log(reports[i]); - } else { - console.log("Found unknown type of String in en.json!") - console.log(reports[i]); - } + } } - var json = JSON.stringify(localeObj, null, '\t'); //convert it back to json + var json = JSON.stringify(localeObj, null, '\t'); //convert it back to json-string fs.writeFile(path, json, 'utf8', function callback(err) { if (err) throw err; - console.log('It\'s saved!'); + console.log('Extracted all strings!'); }); } });