handle missing languages and other errors

...when checking translations for HTML
pull/1/head
ansuz 3 years ago
parent 7bdabb5cbc
commit b2ed8f4fb0

@ -9,6 +9,7 @@ var simpleTags = [
// FIXME
"<a href='#'>",
'<a href="#docs">',
'<h3>',
'</h3>',
@ -70,7 +71,7 @@ processLang(EN, 'en', true);
[
'ar',
'bn_BD',
//'bn_BD',
'ca',
'de',
'es',
@ -86,11 +87,15 @@ processLang(EN, 'en', true);
'ro',
'ru',
'sv',
'te',
//'te',
'tr',
'zh',
].forEach(function (lang) {
var map = require("../www/common/translations/messages." + lang + ".json");
if (!Object.keys(map).length) { return; }
processLang(map, lang);
try {
var map = require("../www/common/translations/messages." + lang + ".json");
if (!Object.keys(map).length) { return; }
processLang(map, lang);
} catch (err) {
console.error(err);
}
});

@ -0,0 +1,19 @@
var Pins = require("../lib/pins");
var Fs = require("fs");
var content = Fs.readFileSync('./data/pins/Bp/BpL3pEyX2IlfsvxQELB9uz5qh+40re0gD6J6LOobBm8=.ndjson', 'utf8');
//var lines = content.split("\n");
//console.log(content);
var result;
for (var i = 0; i < 10000; i++) {
result = Pins.calculateFromLog(content, function (label, data) {
console.log([label, data]);
});
}
//console.log(result, result.length);
Loading…
Cancel
Save