mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
Merge ba98af7e52 into 508f1551e3
This commit is contained in:
commit
a2d9b5bc4b
1 changed files with 8 additions and 0 deletions
|
|
@ -112,6 +112,14 @@ func root(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
defaultLocale := *c.App.Srv().Config().LocalizationSettings.DefaultClientLocale
|
||||
htmlTagWithLangTemplate := `<html lang="%s">`
|
||||
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 := "<title>%s</title>"
|
||||
originalHTML := fmt.Sprintf(titleTemplate, html.EscapeString(model.TeamSettingsDefaultSiteName))
|
||||
modifiedHTML := getOpenGraphMetaTags(c)
|
||||
|
|
|
|||
Loading…
Reference in a new issue