A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(template/i18n): homepage convert
kumfobe753459f64b
diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.goindex d78f6a73..c986ad4e 100644--- a/internal/controller/template_controller.go+++ b/internal/controller/template_controller.go@@ -3,6 +3,7 @@ package controllerimport ("encoding/json""fmt"+ "github.com/segmentfault/pacman/i18n""html/template""net/http""regexp"@@ -307,7 +308,7 @@ func (tc *TemplateController) html(ctx *gin.Context, code int, tpl string, siteIdata["siteinfo"] = siteInfodata["scriptPath"] = tc.scriptPathdata["cssPath"] = tc.cssPath- data["language"] = handler.GetLang(ctx)+ data["language"] = i18n.LanguageChinese //handler.GetLang(ctx)data["timezone"] = siteInfo.Interface.TimeZonectx.HTML(code, tpl, data)diff --git a/ui/template/homepage.html b/ui/template/homepage.htmlindex 6b2e19f3..dac6b9ad 100644--- a/ui/template/homepage.html+++ b/ui/template/homepage.html@@ -15,13 +15,13 @@<div class="text-secondary mb-4">@{{.userinfo.Info.Username}}</div><div class="d-flex flex-wrap mb-3"><div class="me-3">- <strong class="fs-5">{{.userinfo.Info.Rank}}</strong><span class="text-secondary"> reputation</span>+ <strong class="fs-5">{{.userinfo.Info.Rank}}</strong><span class="text-secondary"> {{translator $.language "ui.personal.x_reputation"}}</span></div><div class="me-3">- <strong class="fs-5">{{.userinfo.Info.AnswerCount}}</strong><span class="text-secondary"> answers</span>+ <strong class="fs-5">{{.userinfo.Info.AnswerCount}}</strong><span class="text-secondary"> {{translator $.language "ui.personal.x_answers"}}</span></div><div>- <strong class="fs-5">{{.userinfo.Info.QuestionCount}}</strong><span class="text-secondary"> questions</span>+ <strong class="fs-5">{{.userinfo.Info.QuestionCount}}</strong><span class="text-secondary"> {{translator $.language "ui.personal.x_questions"}}</span></div></div>{{if .userinfo.Info.Website }}@@ -40,11 +40,11 @@<div class="col-xxl-7 col-lg-8 col-sm-12"><div>- <h5 class="mb-3">About Me</h5>+ <h5 class="mb-3">{{translator $.language "ui.personal.about_me"}}</h5>{{if .bio }}<div class="text-center mb-4">{{.bio}}</div>{{else}}- <div class="text-center py-5 mb-4">// Hello, World !</div>+ <div class="text-center py-5 mb-4">{{translator $.language "ui.personal.about_me_empty"}}</div>{{end}}</div></div>