From c300b32e733281c86d0b7affd666b690107ea5f4 Mon Sep 17 00:00:00 2001 From: Alden Lu Date: Wed, 11 Jun 2025 21:22:59 +0000 Subject: [PATCH 1/2] Replace root tag with localized lang root --- server/channels/web/static.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/channels/web/static.go b/server/channels/web/static.go index b1fbde369a0..fe329c1b615 100644 --- a/server/channels/web/static.go +++ b/server/channels/web/static.go @@ -90,6 +90,14 @@ func root(c *Context, w http.ResponseWriter, r *http.Request) { return } + defaultLocale := *c.App.Srv().Config().LocalizationSettings.DefaultServerLocale + 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) From ba98af7e52d46bdee0fe35fe5cde0bf2de43cb78 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Wed, 18 Mar 2026 11:04:13 +0100 Subject: [PATCH 2/2] Update server/channels/web/static.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- server/channels/web/static.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/channels/web/static.go b/server/channels/web/static.go index d2e10905896..656393f0d2d 100644 --- a/server/channels/web/static.go +++ b/server/channels/web/static.go @@ -112,7 +112,7 @@ func root(c *Context, w http.ResponseWriter, r *http.Request) { return } - defaultLocale := *c.App.Srv().Config().LocalizationSettings.DefaultServerLocale + defaultLocale := *c.App.Srv().Config().LocalizationSettings.DefaultClientLocale htmlTagWithLangTemplate := `` localizedHtmlTag := fmt.Sprintf(htmlTagWithLangTemplate, html.EscapeString(defaultLocale)) defaultEnglishHtmlTag := fmt.Sprintf(htmlTagWithLangTemplate, "en")