diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-02-15 05:48:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 21:48:45 +0000 |
commit | f3eb835886031df7a562abc123c3f6011c81eca8 (patch) | |
tree | 6db218680b00a81f2ea46675d5dde94642a232b9 /models/shared | |
parent | 94d06be035bac468129903c9f32e785baf3c1c3b (diff) | |
download | gitea-f3eb835886031df7a562abc123c3f6011c81eca8.tar.gz gitea-f3eb835886031df7a562abc123c3f6011c81eca8.zip |
Refactor locale&string&template related code (#29165)
Clarify when "string" should be used (and be escaped), and when
"template.HTML" should be used (no need to escape)
And help PRs like #29059 , to render the error messages correctly.
Diffstat (limited to 'models/shared')
-rw-r--r-- | models/shared/types/ownertype.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/shared/types/ownertype.go b/models/shared/types/ownertype.go index e6fe4e4cfd..a1d46c986f 100644 --- a/models/shared/types/ownertype.go +++ b/models/shared/types/ownertype.go @@ -17,13 +17,13 @@ const ( func (o OwnerType) LocaleString(locale translation.Locale) string { switch o { case OwnerTypeSystemGlobal: - return locale.Tr("concept_system_global") + return locale.TrString("concept_system_global") case OwnerTypeIndividual: - return locale.Tr("concept_user_individual") + return locale.TrString("concept_user_individual") case OwnerTypeRepository: - return locale.Tr("concept_code_repository") + return locale.TrString("concept_code_repository") case OwnerTypeOrganization: - return locale.Tr("concept_user_organization") + return locale.TrString("concept_user_organization") } - return locale.Tr("unknown") + return locale.TrString("unknown") } |