Skip to content

Commit

Permalink
NewLocale with nameInsenstive
Browse files Browse the repository at this point in the history
  • Loading branch information
YamiOdymel committed May 21, 2023
1 parent ab767c6 commit 802e8bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (i *I18n) LoadFS(fsys fs.FS, patterns ...string) error {
func (i *I18n) NewLocale(locales ...string) *Locale {
selectedLocale := i.defaultLocale
for _, v := range locales {
v = nameInsenstive(v)
if _, ok := i.compiledTranslations[v]; ok {
selectedLocale = v
break
Expand Down

0 comments on commit 802e8bd

Please sign in to comment.