add translation completeness test to assertion page
This commit is contained in:
parent
e07cb984e5
commit
841ded8fdc
@ -4,7 +4,8 @@ define([
|
|||||||
'/bower_components/hyperjson/hyperjson.js',
|
'/bower_components/hyperjson/hyperjson.js',
|
||||||
'/bower_components/textpatcher/TextPatcher.amd.js',
|
'/bower_components/textpatcher/TextPatcher.amd.js',
|
||||||
'json.sortify',
|
'json.sortify',
|
||||||
], function (jQuery, Hyperjson, TextPatcher, Sortify) {
|
'/common/cryptpad-common.js',
|
||||||
|
], function (jQuery, Hyperjson, TextPatcher, Sortify, Cryptpad) {
|
||||||
var $ = window.jQuery;
|
var $ = window.jQuery;
|
||||||
window.Hyperjson = Hyperjson;
|
window.Hyperjson = Hyperjson;
|
||||||
window.TextPatcher = TextPatcher;
|
window.TextPatcher = TextPatcher;
|
||||||
@ -140,6 +141,19 @@ define([
|
|||||||
strungJSON(orig);
|
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) {
|
var swap = function (str, dict) {
|
||||||
return str.replace(/\{\{(.*?)\}\}/g, function (all, key) {
|
return str.replace(/\{\{(.*?)\}\}/g, function (all, key) {
|
||||||
return typeof dict[key] !== 'undefined'? dict[key] : all;
|
return typeof dict[key] !== 'undefined'? dict[key] : all;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user