diff options
| author | Horus3 | 2015-05-17 03:52:11 +0200 |
|---|---|---|
| committer | Horus3 | 2015-05-17 03:52:11 +0200 |
| commit | 822176955a0b85c09b29eaf94b2f53c97fa57038 (patch) | |
| tree | 8eb6f091589af8787a390ccc906a2e9937a29ead | |
| parent | cc207536d1f8618385d9807906818180cd596777 (diff) | |
| download | freemail-822176955a0b85c09b29eaf94b2f53c97fa57038.tar.gz | |
Small fix with language detection.
| -rw-r--r-- | server.go | 5 | ||||
| -rw-r--r-- | views/footer.html | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -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); })(); |
