lang/i18n: Fix for language code case issue with pt-br etc.

Fixes #7804
This commit is contained in:
Bjørn Erik Pedersen
2020-10-09 10:00:50 +02:00
parent 49972d0792
commit 506820435c
6 changed files with 77 additions and 8 deletions

View File

@@ -226,6 +226,18 @@ one = "abc"`),
expected: "Show Me The Money",
expectedFlag: "Show Me The Money",
},
// https: //github.com/gohugoio/hugo/issues/7804
{
name: "lang-with-hyphen",
data: map[string][]byte{
"pt-br.toml": []byte(`foo.one = "abc"`),
},
args: 1,
lang: "pt-br",
id: "foo",
expected: "abc",
expectedFlag: "abc",
},
}
func doTestI18nTranslate(t testing.TB, test i18nTest, cfg config.Provider) string {