From 802e8bd529f2aea8f0a1c712540644403917a080 Mon Sep 17 00:00:00 2001 From: Yami Odymel Date: Mon, 22 May 2023 06:15:39 +0800 Subject: [PATCH] NewLocale with nameInsenstive --- i18n.go | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n.go b/i18n.go index c0520b8..4816e93 100644 --- a/i18n.go +++ b/i18n.go @@ -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