summaryrefslogtreecommitdiffstats
path: root/modules/translation
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-03-04 02:02:51 +0100
committerEarl Warren <contact@earl-warren.org>2024-03-06 05:10:47 +0100
commitde6768ed546fbdd6237798c1fdb0715e7950ecfb (patch)
tree05ab574ac22a184df800447be71e6d3fca988b7e /modules/translation
parentPartial cherry-pick: a4859dcfea Improve user experience for outdated comments... (diff)
downloadforgejo-de6768ed546fbdd6237798c1fdb0715e7950ecfb.tar.xz
forgejo-de6768ed546fbdd6237798c1fdb0715e7950ecfb.zip
Add an trailing slash to dashboard links (#29555)
Fix #29533, and add some tests for "base/paginate.tmpl" (cherry picked from commit 8553b4600e3035b6f6ad6907c37cebd013fa4d64) Conflicts: services/contexttest/context_tests.go trivial conflict because "Improve user experience for outdated comments" was skipped
Diffstat (limited to 'modules/translation')
-rw-r--r--modules/translation/mock.go4
-rw-r--r--modules/translation/translation.go2
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/translation/mock.go b/modules/translation/mock.go
index 1f0559f38d..18fbc1044a 100644
--- a/modules/translation/mock.go
+++ b/modules/translation/mock.go
@@ -9,7 +9,9 @@ import (
)
// MockLocale provides a mocked locale without any translations
-type MockLocale struct{}
+type MockLocale struct {
+ Lang, LangName string // these fields are used directly in templates: ctx.Locale.Lang
+}
var _ Locale = (*MockLocale)(nil)
diff --git a/modules/translation/translation.go b/modules/translation/translation.go
index b7c18f610a..36ae58a9f1 100644
--- a/modules/translation/translation.go
+++ b/modules/translation/translation.go
@@ -144,7 +144,7 @@ func Match(tags ...language.Tag) language.Tag {
// locale represents the information of localization.
type locale struct {
i18n.Locale
- Lang, LangName string // these fields are used directly in templates: .i18n.Lang
+ Lang, LangName string // these fields are used directly in templates: ctx.Locale.Lang
msgPrinter *message.Printer
}