feat: kubesphere 4.0 (#6115)

* feat: kubesphere 4.0

Signed-off-by: ci-bot <ci-bot@kubesphere.io>

* feat: kubesphere 4.0

Signed-off-by: ci-bot <ci-bot@kubesphere.io>

---------

Signed-off-by: ci-bot <ci-bot@kubesphere.io>
Co-authored-by: ks-ci-bot <ks-ci-bot@example.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
KubeSphere CI Bot
2024-09-06 11:05:52 +08:00
committed by GitHub
parent b5015ec7b9
commit 447a51f08b
8557 changed files with 546695 additions and 1146174 deletions

View File

@@ -38,18 +38,28 @@ func (i Ident) Pluralize() Ident {
pluralMoot.RLock()
defer pluralMoot.RUnlock()
// check if the Original has an explicit entry in the map
if p, ok := singleToPlural[i.Original]; ok {
return i.ReplaceSuffix(i.Original, p)
}
if _, ok := pluralToSingle[i.Original]; ok {
return i
}
ls := strings.ToLower(s)
if _, ok := pluralToSingle[ls]; ok {
return i
}
if p, ok := singleToPlural[ls]; ok {
if s == Capitalize(s) {
p = Capitalize(p)
}
return i.ReplaceSuffix(s, p)
}
for _, r := range pluralRules {
if strings.HasSuffix(ls, r.suffix) {
if strings.HasSuffix(s, r.suffix) {
return i.ReplaceSuffix(s, r.fn(s))
}
}