Do not load all the translations anymore, only the needed one

This commit is contained in:
yflory
2017-02-20 18:29:06 +01:00
parent 434c3a220c
commit 454d1c2052
11 changed files with 111 additions and 138 deletions

View File

@@ -5,17 +5,19 @@ define([
var $ = window.jQuery;
var $body = $('body');
var missing = Cryptpad.Messages._checkTranslationState();
var pre = function (text, opt) {
return $('<pre>', 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');
}
var todo = function (missing) {
if (missing.length) {
$body.append(pre(missing.map(function (msg) {
return '* ' + msg;
}).join('\n')));
} else {
$body.text('All keys are present in all translations');
}
};
Cryptpad.Messages._checkTranslationState(todo);
});