aboutsummaryrefslogtreecommitdiff
path: root/internal/context
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-03-09 02:08:53 +0800
committerᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-03-09 02:08:53 +0800
commite87f1107ca74c267ec0ef07054085b7a7871eb77 (patch)
tree95c7a8aaddbabcc16f74f8d8b3a15ee5e1c7b527 /internal/context
parentbebaf4c1122d641affbeaead2b77807072bc51a7 (diff)
commit: fix unexpected truncation in title
The commit message should not be treated as locale at all.
Diffstat (limited to 'internal/context')
-rw-r--r--internal/context/context.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/context/context.go b/internal/context/context.go
index 44bb6eed..b4809ec7 100644
--- a/internal/context/context.go
+++ b/internal/context/context.go
@@ -46,9 +46,14 @@ type Context struct {
Org *Organization
}
-// Title sets "Title" field in template data.
+// RawTitle sets the "Title" field in template data.
+func (c *Context) RawTitle(title string) {
+ c.Data["Title"] = title
+}
+
+// Title localizes the "Title" field in template data.
func (c *Context) Title(locale string) {
- c.Data["Title"] = c.Tr(locale)
+ c.RawTitle(c.Tr(locale))
}
// PageIs sets "PageIsxxx" field in template data.