From 0ca1775657fbd1f84ef6a4a69f3df8e7b9044af5 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 2 Feb 2017 11:27:08 +0100 Subject: [PATCH] add page for listing missing translations --- www/assert/translations/index.html | 10 ++++++++++ www/assert/translations/main.js | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 www/assert/translations/index.html create mode 100644 www/assert/translations/main.js diff --git a/www/assert/translations/index.html b/www/assert/translations/index.html new file mode 100644 index 000000000..4b9e7b715 --- /dev/null +++ b/www/assert/translations/index.html @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/www/assert/translations/main.js b/www/assert/translations/main.js new file mode 100644 index 000000000..6ff862213 --- /dev/null +++ b/www/assert/translations/main.js @@ -0,0 +1,21 @@ +define([ + '/bower_components/jquery/dist/jquery.min.js', + '/common/cryptpad-common.js', +], function (jQuery, Cryptpad) { + var $ = window.jQuery; + + var $body = $('body'); + var missing = Cryptpad.Messages._checkTranslationState(); + + var pre = function (text, opt) { + return $('
', opt).text(text);
+    };
+
+    if (missing.length) {
+        $body.append(pre(missing.map(function (msg) {
+            return '* ' + msg;
+        }).join('\n')));
+    } else {
+        $body.text('All keys are present in all translations');
+    }
+});