add translation completeness test to assertion page
parent
e07cb984e5
commit
841ded8fdc
www/assert
|
@ -4,7 +4,8 @@ define([
|
|||
'/bower_components/hyperjson/hyperjson.js',
|
||||
'/bower_components/textpatcher/TextPatcher.amd.js',
|
||||
'json.sortify',
|
||||
], function (jQuery, Hyperjson, TextPatcher, Sortify) {
|
||||
'/common/cryptpad-common.js',
|
||||
], function (jQuery, Hyperjson, TextPatcher, Sortify, Cryptpad) {
|
||||
var $ = window.jQuery;
|
||||
window.Hyperjson = Hyperjson;
|
||||
window.TextPatcher = TextPatcher;
|
||||
|
@ -140,6 +141,19 @@ define([
|
|||
strungJSON(orig);
|
||||
});
|
||||
|
||||
assert(function () {
|
||||
var missing = Cryptpad.Messages._checkTranslationState();
|
||||
|
||||
if (missing.length !== 0) {
|
||||
missing.forEach(function (msg) {
|
||||
console.log('* ' + msg);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, "expected all translation keys in default language to be present in all translations. See console for details.");
|
||||
|
||||
var swap = function (str, dict) {
|
||||
return str.replace(/\{\{(.*?)\}\}/g, function (all, key) {
|
||||
return typeof dict[key] !== 'undefined'? dict[key] : all;
|
||||
|
|
Loading…
Reference in New Issue