remove outdated translation checks
parent
1785f79f7f
commit
d4291fb3ed
@ -1,10 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
||||||
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
|||||||
define([
|
|
||||||
'jquery',
|
|
||||||
'/common/common-util.js',
|
|
||||||
'/customize/messages.js',
|
|
||||||
'json!/common/translations/messages.json',
|
|
||||||
], function ($, Util, Messages, English) {
|
|
||||||
|
|
||||||
var $body = $('body');
|
|
||||||
|
|
||||||
var pre = function (text, opt) {
|
|
||||||
return $('<pre>', opt).text(text);
|
|
||||||
};
|
|
||||||
|
|
||||||
var todo = function (missing) {
|
|
||||||
var currentLang = "";
|
|
||||||
var currentState = 1;
|
|
||||||
|
|
||||||
if (missing.length) {
|
|
||||||
$body.append(pre(missing.map(function (msg) {
|
|
||||||
var res = "";
|
|
||||||
var lang = msg[0];
|
|
||||||
var key = msg[1]; // Array
|
|
||||||
var state = msg[2]; // 0 === toDelete, 1 === missing, 2 === updated, 3 === invalid (wrong type)
|
|
||||||
var value = msg[3] || '""';
|
|
||||||
|
|
||||||
if (currentLang !== lang) {
|
|
||||||
if (currentLang !== "")
|
|
||||||
{
|
|
||||||
res += '\n';
|
|
||||||
}
|
|
||||||
currentLang = lang;
|
|
||||||
res += '/*\n *\n * ' + lang + '\n *\n */\n\n';
|
|
||||||
}
|
|
||||||
if (currentState !== state) {
|
|
||||||
currentState = state;
|
|
||||||
if (currentState === 0)
|
|
||||||
{
|
|
||||||
res += '\n// TODO: These keys are not needed anymore and should be removed ('+ lang + ')\n\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res += (currentState ? '' : '// ') + 'out.' + key.join('.') + ' = ' + value + ';';
|
|
||||||
if (currentState === 1) {
|
|
||||||
res += ' // ' + JSON.stringify(Util.find(English, key));
|
|
||||||
} else if (currentState === 2) {
|
|
||||||
res += ' // TODO: Key updated --> make sure the updated key "'+ value +'" exists and is translated before this one.';
|
|
||||||
} else if (currentState === 3) {
|
|
||||||
res += ' // NOTE: this key has an invalid type! Original value: ' + JSON.stringify(Util.find(English, key));
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}).join('\n')));
|
|
||||||
} else {
|
|
||||||
$body.text('// All keys are present in all translations');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Messages._checkTranslationState(todo);
|
|
||||||
});
|
|
Loading…
Reference in New Issue