Skip to content

Commit

Permalink
Fix bug in GetLanguage()
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Feb 24, 2023
1 parent 412a8b5 commit 910816c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ func GetConfigDataSourceName() string {
}

func GetLanguage(language string) string {
if language == "" {
if language == "" || language == "*" {
return "en"
}

language = language[0:2]
if len(language) < 2 {
return "en"
}

language = language[0:2]
if strings.Contains(GetConfigString("languages"), language) {
return language
} else {
Expand Down

0 comments on commit 910816c

Please sign in to comment.