mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
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.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user