You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ownertype.go 757B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package types
  4. import "code.gitea.io/gitea/modules/translation"
  5. type OwnerType string
  6. const (
  7. OwnerTypeSystemGlobal = "system-global"
  8. OwnerTypeIndividual = "individual"
  9. OwnerTypeRepository = "repository"
  10. OwnerTypeOrganization = "organization"
  11. )
  12. func (o OwnerType) LocaleString(locale translation.Locale) string {
  13. switch o {
  14. case OwnerTypeSystemGlobal:
  15. return locale.Tr("concept_system_global")
  16. case OwnerTypeIndividual:
  17. return locale.Tr("concept_user_individual")
  18. case OwnerTypeRepository:
  19. return locale.Tr("concept_code_repository")
  20. case OwnerTypeOrganization:
  21. return locale.Tr("concept_user_organization")
  22. }
  23. return locale.Tr("unknown")
  24. }