PLT-7 adding loc header

This commit is contained in:
=Corey Hulen
2016-01-22 10:38:14 -06:00
parent 34b461c1b2
commit 7e9b6dfcd0

View File

@@ -68,7 +68,7 @@ func SetTranslations(locale string) i18n.TranslateFunc {
}
func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
headerLocale = strings.Split(strings.Split(r.Header.Get("Accept-Language"), ",")[0], "-")[0]
headerLocale := strings.Split(strings.Split(r.Header.Get("Accept-Language"), ",")[0], "-")[0]
if locales[headerLocale] != "" {
translations, _ := i18n.Tfunc(locale)
return translations, headerLocale