mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-7 adding loc header
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user