2023-05-12 02:43:27 -06:00
|
|
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
package types
|
|
|
|
|
|
|
|
import "code.gitea.io/gitea/modules/translation"
|
|
|
|
|
|
|
|
type OwnerType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
OwnerTypeSystemGlobal = "system-global"
|
|
|
|
OwnerTypeIndividual = "individual"
|
|
|
|
OwnerTypeRepository = "repository"
|
|
|
|
OwnerTypeOrganization = "organization"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (o OwnerType) LocaleString(locale translation.Locale) string {
|
|
|
|
switch o {
|
|
|
|
case OwnerTypeSystemGlobal:
|
2024-02-14 14:48:45 -07:00
|
|
|
return locale.TrString("concept_system_global")
|
2023-05-12 02:43:27 -06:00
|
|
|
case OwnerTypeIndividual:
|
2024-02-14 14:48:45 -07:00
|
|
|
return locale.TrString("concept_user_individual")
|
2023-05-12 02:43:27 -06:00
|
|
|
case OwnerTypeRepository:
|
2024-02-14 14:48:45 -07:00
|
|
|
return locale.TrString("concept_code_repository")
|
2023-05-12 02:43:27 -06:00
|
|
|
case OwnerTypeOrganization:
|
2024-02-14 14:48:45 -07:00
|
|
|
return locale.TrString("concept_user_organization")
|
2023-05-12 02:43:27 -06:00
|
|
|
}
|
2024-02-14 14:48:45 -07:00
|
|
|
return locale.TrString("unknown")
|
2023-05-12 02:43:27 -06:00
|
|
|
}
|