-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
Which is a little inconvenient ...
This fails with:
func TestDefaaultConfigLanguageBlankWhenNoEnglishExists(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
baseURL = "https://example.com"
[languages]
[languages.nn]
weight = 20
[languages.sv]
weight = 10
-- layouts/all.html --
All.
`
b := hugolib.Test(t, files)
b.Assert(b.H.Conf.DefaultContentLanguage(), qt.Equals, "sv")
}
failed to decode "languages": config value "en" for defaultContentLanguage does not match any language definition`
We should be smarter here and pick the first (sv) language.
Edit in: Looking at some failing tests, I would say that to avoid breakage we need to:
- If
enis one of the languages, we pick that as the default. - Else the first language.