aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/hugo_sites_build_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-11-26 09:44:31 +0100
committerBjørn Erik Pedersen <[email protected]>2019-11-26 12:55:00 +0100
commit96f09659ce8752c32a2a6429c9faf23be4faa091 (patch)
treeba179894eddd24214697b98a19926c4f3c9a9b09 /hugolib/hugo_sites_build_test.go
parent03b369e6726ed8a732c07db48f7209425c434bbe (diff)
downloadhugo-96f09659ce8752c32a2a6429c9faf23be4faa091.tar.gz
hugo-96f09659ce8752c32a2a6429c9faf23be4faa091.zip
Fix language handling in ExecuteAsTemplate
Fixes #6331
Diffstat (limited to 'hugolib/hugo_sites_build_test.go')
-rw-r--r--hugolib/hugo_sites_build_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go
index 03853bff6..e022cb2d3 100644
--- a/hugolib/hugo_sites_build_test.go
+++ b/hugolib/hugo_sites_build_test.go
@@ -1445,5 +1445,17 @@ weight: 2002
PNG Data
`)
+ i18nContent := func(id, value string) string {
+ return fmt.Sprintf(`
+[%s]
+other = %q
+`, id, value)
+ }
+
+ b.WithSourceFile("i18n/en.toml", i18nContent("hello", "Hello"))
+ b.WithSourceFile("i18n/fr.toml", i18nContent("hello", "Bonjour"))
+ b.WithSourceFile("i18n/nb.toml", i18nContent("hello", "Hallo"))
+ b.WithSourceFile("i18n/nn.toml", i18nContent("hello", "Hallo"))
+
return &multiSiteTestBuilder{sitesBuilder: b, configFormat: configFormat, config: config, configData: configData}
}