identify translations with complex inline HTML

pull/1/head
ansuz 4 years ago
parent 60b3728164
commit 774c6864d5

@ -0,0 +1,27 @@
var EN = require("../www/common/translations/messages.json");
var simpleTags = [
'<br>',
'<br />',
];
['a', 'b', 'em', 'p'].forEach(function (tag) {
simpleTags.push('<' + tag + '>');
simpleTags.push('</' + tag + '>');
});
Object.keys(EN).forEach(function (k) {
var s = EN[k];
if (typeof(s) !== 'string') { return; }
var usesHTML;
s.replace(/<.*?>/g, function (html) {
if (simpleTags.indexOf(html) !== -1) { return; }
usesHTML = true;
console.log("{%s}", html);
});
if (usesHTML) {
console.log("[%s] %s\n", k, s);
}
});
Loading…
Cancel
Save