forked from GitHub/dbot
update translation information
* Remove commented out code * Covert translationProgress from an array to an object * Enlargen progress meters * Add translation table
This commit is contained in:
parent
47d5404f38
commit
ad3e597ad2
@ -15,16 +15,6 @@ var pages = function(dbot) {
|
||||
}
|
||||
});
|
||||
|
||||
var trans = [];
|
||||
// THIS IS TOTALLY LEGIT AND OPTIMISED CODE
|
||||
/* for (var j = 0; j < Object.keys(dbot.strings).length; j++) {
|
||||
var str = dbot.strings.j;
|
||||
for (var k = 0; k < Object.keys(dbot.strings.str).length; k++) {
|
||||
var lang = str.lang;
|
||||
trans[lang]++;
|
||||
}
|
||||
} */
|
||||
|
||||
exec("git rev-list --all | wc -l", function(error, stdout, stderr) {
|
||||
rev = stdout;
|
||||
});
|
||||
@ -55,7 +45,7 @@ var pages = function(dbot) {
|
||||
res.render('project', {
|
||||
"translation": dbot.modules.project.api.translationProgress(),
|
||||
"configList": dbot.modules.project.api.configList(),
|
||||
"authors": authors, //dbot.modules.project.api.getAuthors(),
|
||||
"authors": authors,
|
||||
"credits": dbot.t("credits"),
|
||||
"thanks": dbot.t("thanks"),
|
||||
"name": dbot.config.name,
|
||||
|
@ -51,22 +51,20 @@ var project = function(dbot) {
|
||||
translation = translation.concat(cur[j]);
|
||||
}
|
||||
}
|
||||
// optimise this, someone who isn't me
|
||||
var t = [];
|
||||
var t = {};
|
||||
for (var k = 0; k < str.length; k++) {
|
||||
var curr = translation[k];
|
||||
if (t[curr]) {
|
||||
t[curr]["count"] += 1;
|
||||
} else {
|
||||
t[curr] = [];
|
||||
// t[curr]["839"] = curr;
|
||||
t[curr] = {};
|
||||
t[curr]["iso"] = curr;
|
||||
t[curr]["count"] = 1;
|
||||
t[curr]["own"] = dbot.strings[curr][curr];
|
||||
t[curr]["local"] = dbot.t(curr);
|
||||
t[curr]["english"] = dbot.strings[curr]["en"];
|
||||
}
|
||||
}
|
||||
_.compact(t);
|
||||
console.log(t);
|
||||
return t;
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ div#main {
|
||||
h2,h3,h4,h5,h6,.center {
|
||||
text-transform:lowercase;
|
||||
}
|
||||
table#milestones {
|
||||
table {
|
||||
margin:auto;
|
||||
width:80%;
|
||||
}
|
||||
table#milestones td {
|
||||
table td {
|
||||
padding:5px;
|
||||
}
|
||||
p.intro {
|
||||
@ -31,6 +31,7 @@ div.progress {
|
||||
text-align:left;
|
||||
font-size:50%;
|
||||
color:gray;
|
||||
min-width:200px;
|
||||
}
|
||||
div.progress-inner.open {
|
||||
background-color: #3fff3f;
|
||||
|
@ -52,9 +52,28 @@ html(lang='#{curr839}')
|
||||
td #{milestone.open_issues}
|
||||
td #{milestone.closed_issues}
|
||||
h4 Translations
|
||||
ul
|
||||
each key in translation
|
||||
li #{translation[0][1]}
|
||||
table
|
||||
tr
|
||||
th Current
|
||||
th Native
|
||||
th English
|
||||
th Progress
|
||||
th Translations
|
||||
each language in translation
|
||||
- var w = ((language.count/translation.en.count)*100)
|
||||
tr
|
||||
td #{language.local}
|
||||
td #{language.own}
|
||||
td #{language.english}
|
||||
td.prog
|
||||
div.progress(class="open")
|
||||
unless (language.iso == curr839)
|
||||
div.progress-inner(style="width:"+w+"%")(class="open")
|
||||
|
||||
else
|
||||
div.progress-inner(style="width:"+w+"%")(class="closed")
|
||||
|
||||
td #{language.count} / #{translation.en.count}
|
||||
h4 #{credits}
|
||||
#{thanks}
|
||||
ul
|
||||
|
Loading…
Reference in New Issue
Block a user