70 lines
2.7 KiB
HTML
70 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>Localization data for the server</title>
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Localization data for the server</h1>
|
|
<div id="alert"></div>
|
|
<div id="result"></div>
|
|
</div>
|
|
<script>
|
|
var alert = document.getElementById("alert");
|
|
var result = document.getElementById("result");
|
|
|
|
window.onload = function() {
|
|
if (typeof languages !== "undefined" && typeof lines !== "lines") {
|
|
alert.className = "alert alert-success";
|
|
alert.innerHTML = "<span class='glyphicon glyphicon-ok'></span> The data is valid.";
|
|
|
|
var enIndex = languages.indexOf("en");
|
|
|
|
var formattedLanguages = languages.slice()
|
|
.sort()
|
|
.map(function(language) {
|
|
return "<strong>" + language + "</strong>";
|
|
});
|
|
|
|
var missingTexts = "";
|
|
var missingTextCountByLanguage = {};
|
|
|
|
Object.keys(lines).forEach(function(lineId) {
|
|
lines[lineId].forEach(function(text, languageIndex, texts) {
|
|
if (!text) {
|
|
var languageCode = languages[languageIndex];
|
|
missingTexts += "<li><strong>" + lineId + "</strong> for <strong>" + languageCode + "</strong> (<em>" + texts[enIndex] + "</em>)</li>";
|
|
|
|
if (!missingTextCountByLanguage[languageCode])
|
|
missingTextCountByLanguage[languageCode] = 1;
|
|
else
|
|
++missingTextCountByLanguage[languageCode];
|
|
}
|
|
});
|
|
});
|
|
|
|
var html = "<p><strong>" + formattedLanguages.length + "</strong> formattedLanguages: " + languages.join(", ") + ".</p>" +
|
|
"<p>You should now submit your pending changelists on the <em>CODE</em> Perforce and on the <em>DATA</em> Perforce.</p>";
|
|
|
|
if (missingTexts) {
|
|
html += "<p>Missing texts by language:</p><ul>" + Object.keys(missingTextCountByLanguage).map(function(language) {
|
|
return "<li><strong>" + language + "</strong>: <strong>" + missingTextCountByLanguage[language] + "</strong></li>";
|
|
}).sort().join("") + "</ul>" +
|
|
"<p>Missing texts:</p><ul>" + missingTexts + "</ul>";
|
|
}
|
|
|
|
result.innerHTML = html;
|
|
} else {
|
|
alert.className = "alert alert-danger";
|
|
alert.innerHTML = "<span class='glyphicon glyphicon-remove'></span> The data is invalid.";
|
|
|
|
result.innerHTML = "<p>Send your generated file <strong>//jd_production/main/data/EngineData/Localisation/localisation.js</strong> (in the <em>DATA</em> Perforce) to <a href='mailto:JD2016OnlineMRC@ubisoft.com?subject=Invalid localization data for the server'>JD2016 Online MRC</a>.</p>";
|
|
}
|
|
};
|
|
</script>
|
|
<script src="localisation.js"></script>
|
|
</body>
|
|
</html>
|