Skip to content

Commit ddaf0cb

Browse files
author
Gusted
committed
Fix latest translation
1 parent f466981 commit ddaf0cb

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

modules/markup/markdown/toc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/url"
1010

1111
"code.gitea.io/gitea/modules/markup"
12-
"code.gitea.io/gitea/modules/translation/i18n"
12+
"code.gitea.io/gitea/modules/translation"
1313

1414
"github.com/yuin/goldmark/ast"
1515
)
@@ -18,7 +18,7 @@ func createTOCNode(toc []markup.Header, lang string) ast.Node {
1818
details := NewDetails()
1919
summary := NewSummary()
2020

21-
summary.AppendChild(summary, ast.NewString([]byte(i18n.Tr(lang, "toc"))))
21+
summary.AppendChild(summary, ast.NewString([]byte(translation.NewLocale(lang).Tr("toc"))))
2222
details.AppendChild(details, summary)
2323
ul := ast.NewList('-')
2424
details.AppendChild(details, ul)

routers/web/repo/issue_content_history.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"code.gitea.io/gitea/modules/log"
1818
"code.gitea.io/gitea/modules/setting"
1919
"code.gitea.io/gitea/modules/timeutil"
20-
"code.gitea.io/gitea/modules/translation/i18n"
2120

2221
"github.com/sergi/go-diff/diffmatchpatch"
2322
)
@@ -29,14 +28,13 @@ func GetContentHistoryOverview(ctx *context.Context) {
2928
return
3029
}
3130

32-
lang := ctx.Locale.Language()
3331
editedHistoryCountMap, _ := issues_model.QueryIssueContentHistoryEditedCountMap(ctx, issue.ID)
3432
ctx.JSON(http.StatusOK, map[string]interface{}{
3533
"i18n": map[string]interface{}{
36-
"textEdited": i18n.Tr(lang, "repo.issues.content_history.edited"),
37-
"textDeleteFromHistory": i18n.Tr(lang, "repo.issues.content_history.delete_from_history"),
38-
"textDeleteFromHistoryConfirm": i18n.Tr(lang, "repo.issues.content_history.delete_from_history_confirm"),
39-
"textOptions": i18n.Tr(lang, "repo.issues.content_history.options"),
34+
"textEdited": ctx.Tr("repo.issues.content_history.edited"),
35+
"textDeleteFromHistory": ctx.Tr("repo.issues.content_history.delete_from_history"),
36+
"textDeleteFromHistoryConfirm": ctx.Tr("repo.issues.content_history.delete_from_history_confirm"),
37+
"textOptions": ctx.Tr("repo.issues.content_history.options"),
4038
},
4139
"editedHistoryCountMap": editedHistoryCountMap,
4240
})

0 commit comments

Comments
 (0)