summaryrefslogtreecommitdiffstats
path: root/utils/i18n.go
diff options
context:
space:
mode:
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 6811796fd..e02fee558 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 + "'")
}
@@ -71,14 +71,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)
@@ -125,7 +125,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 := ""