diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-21 14:36:46 -0600 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-21 14:36:46 -0600 |
commit | 6c86bae5d54a2f24733512e6c9eee78a832a45e3 (patch) | |
tree | 4e1db4ba11bc8dff70a8049ab887588686fa4d47 /utils/i18n.go | |
parent | a2fa683c1b5fc0c62506e3ac40784b053eda6e3e (diff) | |
parent | 3ff05780a1b4f08d256a983bc9ec06f9841f0538 (diff) | |
download | chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.tar.gz chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.tar.bz2 chat-6c86bae5d54a2f24733512e6c9eee78a832a45e3.zip |
Merge pull request #1949 from mattermost/PLT-7-client-infra
PLT-7 client infra
Diffstat (limited to 'utils/i18n.go')
-rw-r--r-- | utils/i18n.go | 18 |
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 := "" |