diff --git a/server/channels/web/static.go b/server/channels/web/static.go index bcc4e808281..656393f0d2d 100644 --- a/server/channels/web/static.go +++ b/server/channels/web/static.go @@ -112,6 +112,14 @@ func root(c *Context, w http.ResponseWriter, r *http.Request) { return } + defaultLocale := *c.App.Srv().Config().LocalizationSettings.DefaultClientLocale + htmlTagWithLangTemplate := `` + localizedHtmlTag := fmt.Sprintf(htmlTagWithLangTemplate, html.EscapeString(defaultLocale)) + defaultEnglishHtmlTag := fmt.Sprintf(htmlTagWithLangTemplate, "en") + if bytes.Contains(contents, []byte(defaultEnglishHtmlTag)) { + contents = bytes.ReplaceAll(contents, []byte(defaultEnglishHtmlTag), []byte(localizedHtmlTag)) + } + titleTemplate := "%s" originalHTML := fmt.Sprintf(titleTemplate, html.EscapeString(model.TeamSettingsDefaultSiteName)) modifiedHTML := getOpenGraphMetaTags(c)