updated

This commit is contained in:
landaiqing
2024-11-14 01:58:20 +08:00
parent c95d5fc041
commit 3b8e3df27a
83 changed files with 172212 additions and 343 deletions

View File

@@ -1,14 +0,0 @@
package i18n
import "golang.org/x/text/language"
func MatchCurrentLanguageTag(accept string, supportTags []language.Tag) language.Tag {
langTags, _, err := language.ParseAcceptLanguage(accept)
if err != nil {
langTags = []language.Tag{language.English}
}
var matcher = language.NewMatcher(supportTags)
_, i, _ := matcher.Match(langTags...)
tag := supportTags[i]
return tag
}