convert to dbot.t; add Italian; add debugMode

This commit is contained in:
Douglas Gardner 2013-04-18 11:45:15 +00:00
parent 2a4698c982
commit d3f8e295be
3 changed files with 51 additions and 29 deletions

View File

@ -1,39 +1,29 @@
var exec = require('child_process').exec; var exec = require('child_process').exec;
var pages = function(dbot) { var pages = function(dbot) {
var lang = dbot.config.language;
/*
var modules = function() {
var modlist = dbot.config.moduleNames;
var formatted = "<ul>"
for (var i = 0, i < modlist.length; i++) {
formatted += "<li>" + modlist[i] + "</li>;
}
formatted += "</ul>"
return formatted;
} */
var rev; var rev;
exec("git rev-list --all | wc -l", function(a,b,c){rev = b}); exec("git rev-list --all | wc -l", function(a,b,c){rev = b});
return { return {
'/project': function(req, res) { '/project': function(req, res) {
res.render('project', { res.render('project', {
"name": dbot.config.name, "name": dbot.config.name,
"curr839": lang, "curr839": dbot.config.language,
"currver": dbot.config.version, "currver": dbot.config.version,
"currlang": dbot.strings["dbotspeaks"][lang].format({ // dbot.t won't work s; "currlang": dbot.t("dbotspeaks",{
"lang839": lang, "lang839": dbot.config.language,
"langen": dbot.strings[lang]["en"], "langen": dbot.strings[dbot.config.language]["en"],
"lang": dbot.strings[lang][lang], "lang": dbot.t(dbot.config.language),
"name": dbot.config.name "name": dbot.config.name
}), }),
"projectstatus": dbot.strings["projectstatus"][lang], "projectstatus": dbot.t("projectstatus"),
"revnum": dbot.strings["revnum"][lang].format({ "revnum": dbot.t("revnum",{
"name": dbot.config.name, "name": dbot.config.name,
"rev": rev, "rev": rev,
"ver": "abcdef" // TODO, obviously "ver": "abcdef" // TODO, obviously
}), }),
"modules": dbot.config.moduleNames, "modules": dbot.config.moduleNames,
"loadmod": dbot.strings["loadedmodules"][lang] "loadmod": dbot.t("loadedmodules"),
"debugmode": dbot.t("debugmode-" + dbot.config.debugMode)
}); });
}, },
}; };

View File

@ -2,35 +2,66 @@
"dbotspeaks": { "dbotspeaks": {
"en": "{name} speaks {lang} ({langen})", "en": "{name} speaks {lang} ({langen})",
"de": "{name} spricht {lang} ({langen})", "de": "{name} spricht {lang} ({langen})",
"fr": "{name} parle {lang} ({langen})" "fr": "{name} parle {lang} ({langen})",
"it": "{name} parla {lang} ({langen})"
}, },
"en": { "en": {
"en": "English", "en": "English",
"fr": "anglais", "fr": "anglais",
"de": "Englisch" "de": "Englisch",
"it": "inglese"
}, },
"fr": { "fr": {
"en": "French", "en": "French",
"fr": "français", "fr": "français",
"de": "Französisch" "de": "Französisch",
"it": "francese"
}, },
"de": { "de": {
"en": "German", "en": "German",
"fr": "allemande", "fr": "allemande",
"de": "Deutsch" "de": "Deutsch",
"it": "tedesco"
},
"it": {
"en": "Italian",
"fr": "italien",
"de": "Italienier",
"it": "italiano"
}, },
"projectstatus": { "projectstatus": {
"en": "Project Status", "en": "project status",
"fr": "Situation du Projet", "fr": "situation du projet",
"de": "Projektstatus" "de": "Projektstatus",
"it": "stato del progetto"
}, },
"revnum": { "revnum": {
"en": "{name} is at revision {rev} ({ver})", "en": "{name} is at revision {rev} ({ver})",
"fr": "{name} est à révision {rev} ({ver})", "fr": "{name} est à révision {rev} ({ver})",
"de": "{name} ist in der Revision {rev} ({ver})" "de": "{name} ist in der Revision {rev} ({ver})",
"it": "{name} è il numero di revisione {rev} ({ver})"
}, },
"loadedmodules": { "loadedmodules": {
"en": "Loaded modules", "en": "loaded modules",
"fr": "Modules chargés" "fr": "modules chargés",
"it": "moduli caricati"
},
"configuration": {
"en": "Configuration",
"fr": "Configuration",
"de": "Konfiguration",
"it": "configuazione"
},
"debugmode-true": {
"en": "Debug mode active",
"fr": "debug actif",
"de": "Debug aktiv",
"it": "debug attivo"
},
"debugmode-false": {
"en": "Debug off",
"fr": "debug éteint",
"de": "Debug ausgeschaltet",
"it": "debug spento"
} }
} }

View File

@ -10,6 +10,7 @@ block content
h3 Configuration h3 Configuration
ul ul
li #{currlang} li #{currlang}
li #{debugmode}
h4 #{loadmod} h4 #{loadmod}
ul ul
each module in modules each module in modules