From 7f25bc753335f8355889d0f0d34621a43251853a Mon Sep 17 00:00:00 2001 From: ydf <4960943+ydf@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:09:56 +0800 Subject: [PATCH] Lang (#989) * [lang] fix tiny language * [lang] fix lang * [lang] update document lang --------- Co-authored-by: admin --- conf/lang/en-us.ini | 4 +++- conf/lang/zh-cn.ini | 2 ++ controllers/DocumentController.go | 12 ++++++------ controllers/ManagerController.go | 3 +-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/conf/lang/en-us.ini b/conf/lang/en-us.ini index 76771ddd..3537146d 100644 --- a/conf/lang/en-us.ini +++ b/conf/lang/en-us.ini @@ -272,7 +272,7 @@ team_name = Team name member_amount = Number of members join_time = Join Time project_setting = Project setting -handover_project = Hanover +handover_project = Handover make_public = Into Public make_private = Into Privete history_record_amount = Number of history records @@ -443,6 +443,8 @@ ft_create_time = Create time: ft_update_time = Update time: view_count = Number of views changetheme = Switch themes +prev = prev +next = next [project] prj_space_list = Project Space List diff --git a/conf/lang/zh-cn.ini b/conf/lang/zh-cn.ini index b95e0c0a..16ac1fb2 100644 --- a/conf/lang/zh-cn.ini +++ b/conf/lang/zh-cn.ini @@ -443,6 +443,8 @@ ft_create_time = 创建时间: ft_update_time = 更新时间: view_count = 阅读次数 changetheme = 切换主题 +prev = 上一篇 +next = 下一篇 [project] prj_space_list = 项目空间列表 diff --git a/controllers/DocumentController.go b/controllers/DocumentController.go index 35e6f0c4..3beee5ce 100644 --- a/controllers/DocumentController.go +++ b/controllers/DocumentController.go @@ -214,8 +214,8 @@ func (c *DocumentController) Read() { } var PrevName, PrevPath, NextName, NextPath string if index == 0 { - c.Data["PrevName"] = "没有了" - PrevName = "没有了" + c.Data["PrevName"] = "" + PrevName = "" } else { c.Data["PrevPath"] = identify + "/" + flat[index-1].Identify c.Data["PrevName"] = flat[index-1].DocumentName @@ -223,8 +223,8 @@ func (c *DocumentController) Read() { PrevName = flat[index-1].DocumentName } if index == len(flat)-1 { - c.Data["NextName"] = "没有了" - NextName = "没有了" + c.Data["NextName"] = "" + NextName = "" } else { c.Data["NextPath"] = identify + "/" + flat[index+1].Identify c.Data["NextName"] = flat[index+1].DocumentName @@ -251,7 +251,7 @@ func (c *DocumentController) Read() { data.DocId = doc.DocumentId data.DocIdentify = doc.Identify data.DocTitle = doc.DocumentName - data.Body = doc.Release + "
上一篇:
下一篇:
" + data.Body = doc.Release + "
"+ i18n.Tr(c.Lang, "doc.prev") + ":
" + i18n.Tr(c.Lang, "doc.next") + ":
" data.Title = doc.DocumentName + " - Powered by MinDoc" data.Version = doc.Version data.ViewCount = doc.ViewCount @@ -283,7 +283,7 @@ func (c *DocumentController) Read() { c.Data["Model"] = bookResult c.Data["Result"] = template.HTML(tree) c.Data["Title"] = doc.DocumentName - c.Data["Content"] = template.HTML(doc.Release + "
上一篇:
下一篇:
") + c.Data["Content"] = template.HTML(doc.Release + "
"+ i18n.Tr(c.Lang, "doc.prev") + ":
" + i18n.Tr(c.Lang, "doc.next") + ":
") c.Data["ViewCount"] = doc.ViewCount c.Data["FoldSetting"] = "closed" if bookResult.Editor == EditorCherryMarkdown { diff --git a/controllers/ManagerController.go b/controllers/ManagerController.go index 472f6f0e..8328fb26 100644 --- a/controllers/ManagerController.go +++ b/controllers/ManagerController.go @@ -1017,15 +1017,14 @@ func (c *ManagerController) TeamChangeMemberRole() { if memberId <= 0 || roleId <= 0 || teamId <= 0 || roleId > int(conf.BookObserver) { c.JsonResult(5001, i18n.Tr(c.Lang, "message.param_error")) } - teamMember, err := models.NewTeamMember().ChangeRoleId(teamId, memberId, conf.BookRole(roleId)) if err != nil { c.JsonResult(5002, err.Error()) } else { + teamMember.SetLang(c.Lang).Include() c.JsonResult(0, "OK", teamMember) } - } // 团队项目列表.