From e87f1107ca74c267ec0ef07054085b7a7871eb77 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Mon, 9 Mar 2020 02:08:53 +0800 Subject: commit: fix unexpected truncation in title The commit message should not be treated as locale at all. --- internal/context/context.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'internal/context') 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. -- cgit v1.2.3