Fix i18n project vs theme order

Fixes #6134
This commit is contained in:
Bjørn Erik Pedersen
2019-07-29 17:23:10 +02:00
parent e5f9602459
commit 00a238e32c
2 changed files with 16 additions and 10 deletions

View File

@@ -204,7 +204,7 @@ Data C: {{ $data.c.value }}
Data D: {{ $data.d.value }}
All Data: {{ $data }}
i18n hello: {{ i18n "hello" . }}
i18n hello1: {{ i18n "hello1" . }}
i18n theme: {{ i18n "theme" . }}
i18n theme2: {{ i18n "theme2" . }}
`)
@@ -238,9 +238,13 @@ other = %q
b.WithSourceFile("themes/d/data/d.toml", `value="Hugo Rodks!"`)
// i18n files
b.WithSourceFile("i18n/en.toml", i18nContent("hello", "Project"))
b.WithSourceFile("themes/c/en.toml", i18nContent("hello", "Theme C"))
b.WithSourceFile("themes/c/i18n/en.toml", i18nContent("theme", "Theme C"))
b.WithSourceFile("i18n/en.toml", i18nContent("hello1", "Project"))
b.WithSourceFile("themes/c/i18n/en.toml", `
[hello1]
other="Theme C Hello"
[theme]
other="Theme C"
`)
b.WithSourceFile("themes/d/i18n/en.toml", i18nContent("theme", "Theme D"))
b.WithSourceFile("themes/d/i18n/en.toml", i18nContent("theme2", "Theme2 D"))
@@ -261,7 +265,7 @@ other = %q
// i18n
b.AssertFileContent("public/index.html",
"i18n hello: Project",
"i18n hello1: Project",
"i18n theme: Theme C",
"i18n theme2: Theme2 D",
)