summaryrefslogtreecommitdiffstats
path: root/utils/i18n.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-21 14:15:44 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-21 14:15:44 -0600
commit221985435966dbf583d3e367c243822e338b6bc4 (patch)
tree140d0b1318df0d5b11ef21eacf7cfa7545498585 /utils/i18n.go
parent8cc45a2e08c3eaaa66619cc7ee9dfc7ff49b388f (diff)
downloadchat-221985435966dbf583d3e367c243822e338b6bc4.tar.gz
chat-221985435966dbf583d3e367c243822e338b6bc4.tar.bz2
chat-221985435966dbf583d3e367c243822e338b6bc4.zip
PLT-7 client side infra
Diffstat (limited to 'utils/i18n.go')
-rw-r--r--utils/i18n.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/i18n.go b/utils/i18n.go
index 4b7b187a8..7c6db66f6 100644
--- a/utils/i18n.go
+++ b/utils/i18n.go
@@ -44,7 +44,7 @@ func GetTranslationsBySystemLocale() i18n.TranslateFunc {
}
}
- if locales[model.DEFAULT_LOCALE] == "" {
+ if locales[locale] == "" {
panic("Failed to load system translations for '" + model.DEFAULT_LOCALE + "'")
}
@@ -62,14 +62,14 @@ func SetTranslations(locale string) i18n.TranslateFunc {
return translations
}
-func GetTranslations(w http.ResponseWriter, r *http.Request) i18n.TranslateFunc {
- translations, _ := getTranslationsAndLocale(w, r)
- return translations
-}
+// func GetTranslations(w http.ResponseWriter, r *http.Request) i18n.TranslateFunc {
+// translations, _ := getTranslationsAndLocale(w, r)
+// return translations
+// }
-func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
- return getTranslationsAndLocale(w, r)
-}
+// func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
+// return getTranslationsAndLocale(w, r)
+// }
func SetLocaleCookie(w http.ResponseWriter, lang string, sessionCacheInMinutes int) {
maxAge := (sessionCacheInMinutes * 60)
@@ -116,7 +116,7 @@ func SetLocaleCookie(w http.ResponseWriter, lang string, sessionCacheInMinutes i
// })
// }
-func getTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
+func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
var translations i18n.TranslateFunc
var _ error
localeCookie := ""