mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Fix bug in GetLanguage()
This commit is contained in:
parent
412a8b5da7
commit
910816c7a3
@ -106,12 +106,15 @@ func GetConfigDataSourceName() string {
|
||||
}
|
||||
|
||||
func GetLanguage(language string) string {
|
||||
if language == "" {
|
||||
if language == "" || language == "*" {
|
||||
return "en"
|
||||
}
|
||||
|
||||
if len(language) < 2 {
|
||||
return "en"
|
||||
}
|
||||
|
||||
language = language[0:2]
|
||||
|
||||
if strings.Contains(GetConfigString("languages"), language) {
|
||||
return language
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user