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