add template language

This commit is contained in:
aichy126 2023-05-18 12:05:30 +08:00
parent f266da8cea
commit 1860f3ecef
2 changed files with 3 additions and 1 deletions

View File

@ -470,6 +470,8 @@ func (tc *TemplateController) html(ctx *gin.Context, code int, tpl string, siteI
data["description"] = siteInfo.Description
data["language"] = handler.GetLang(ctx)
data["timezone"] = siteInfo.Interface.TimeZone
language := strings.Replace(siteInfo.Interface.Language, "_", "-", -1)
data["lang"] = language
data["HeadCode"] = siteInfo.CustomCssHtml.CustomHead
data["HeaderCode"] = siteInfo.CustomCssHtml.CustomHeader
data["FooterCode"] = siteInfo.CustomCssHtml.CustomFooter

View File

@ -1,6 +1,6 @@
{{define "header"}}
<!DOCTYPE html>
<html>
<html lang="{{.lang}}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />