diff --git a/scripts/find-html-translations.js b/scripts/find-html-translations.js new file mode 100644 index 000000000..fd5a01f54 --- /dev/null +++ b/scripts/find-html-translations.js @@ -0,0 +1,27 @@ +var EN = require("../www/common/translations/messages.json"); + +var simpleTags = [ + '
', + '
', +]; + +['a', 'b', 'em', 'p'].forEach(function (tag) { + simpleTags.push('<' + tag + '>'); + simpleTags.push(''); +}); + +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); + } +});