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

util.go 563 B

2 years ago
123456789101112131415161718192021222324252627282930313233
  1. package cloudbrain
  2. import (
  3. "code.gitea.io/gitea/modules/context"
  4. "code.gitea.io/gitea/modules/setting"
  5. "strings"
  6. )
  7. func GetAiCenterShow(aiCenter string,ctx *context.Context) string{
  8. aiCenterInfo := strings.Split(aiCenter, "+")
  9. if len(aiCenterInfo) == 2{
  10. if setting.C2NetMapInfo!=nil {
  11. if info,ok:=setting.C2NetMapInfo[aiCenterInfo[0]];ok {
  12. if ctx.Language() == "zh-CN" {
  13. return info.Content
  14. } else {
  15. return info.ContentEN
  16. }
  17. }else{
  18. return aiCenterInfo[1]
  19. }
  20. }else{
  21. return aiCenterInfo[1]
  22. }
  23. }
  24. return ""
  25. }