summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.go5
-rw-r--r--views/footer.html2
2 files changed, 7 insertions, 0 deletions
diff --git a/server.go b/server.go
index e5e5d56..a08e117 100644
--- a/server.go
+++ b/server.go
@@ -54,9 +54,14 @@ func CreateNewEntry(email, password string) error {
func ExecTemplate(template string, w http.ResponseWriter, r *http.Request, flash Flash) error {
l := GetLanguage(r)
flash.Language = l
+
+ if flash.Language == "" {
+ flash.Language = "en"
+ }
if l != "" {
l = "_" + l
}
+
template = template + l + ".html"
index := mainTempl.Lookup(template)
diff --git a/views/footer.html b/views/footer.html
index 007474b..db85f61 100644
--- a/views/footer.html
+++ b/views/footer.html
@@ -27,6 +27,7 @@
var u="//a.iamfabulous.de/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 12]);
+ {{if .}}
/*
_paq.push([function () {
if (!this.getCustomVariable(1)) {
@@ -35,6 +36,7 @@
}]);
*/
_paq.push(['setCustomVariable', 1, "Language",{{.}}, "visit"]);
+ {{end}}
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();