From dd136858f1ea40ad3c94191d647487fa4f31926c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.0. Signed-off-by: Daniel Baumann --- models/shared/types/ownertype.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 models/shared/types/ownertype.go (limited to 'models/shared/types') diff --git a/models/shared/types/ownertype.go b/models/shared/types/ownertype.go new file mode 100644 index 0000000..a1d46c9 --- /dev/null +++ b/models/shared/types/ownertype.go @@ -0,0 +1,29 @@ +// 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: + return locale.TrString("concept_system_global") + case OwnerTypeIndividual: + return locale.TrString("concept_user_individual") + case OwnerTypeRepository: + return locale.TrString("concept_code_repository") + case OwnerTypeOrganization: + return locale.TrString("concept_user_organization") + } + return locale.TrString("unknown") +} -- cgit v1.2.3