diff options
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r-- | hugolib/page_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index b0ab7f09c..f22a4d07c 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -1350,6 +1350,51 @@ AllTranslations: {{ range .AllTranslations }}{{ .Language.Lang }}|{{ end }}| ) } +func TestTranslationKeyTermPages(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +disableKinds = ['home','rss','section','sitemap','taxonomy'] +defaultContentLanguage = 'en' +defaultContentLanguageInSubdir = true +[languages.en] +weight = 1 +[languages.pt] +weight = 2 +[taxonomies] +category = 'categories' +-- layouts/_default/list.html -- +{{ .IsTranslated }}|{{ range .Translations }}{{ .RelPermalink }}|{{ end }} +-- layouts/_default/single.html -- +{{ .Title }}| +-- content/p1.en.md -- +--- +title: p1 (en) +categories: [music] +--- +-- content/p1.pt.md -- +--- +title: p1 (pt) +categories: [música] +--- +-- content/categories/music/_index.en.md -- +--- +title: music +translationKey: foo +--- +-- content/categories/música/_index.pt.md -- +--- +title: música +translationKey: foo +--- +` + + b := Test(t, files) + b.AssertFileContent("public/en/categories/music/index.html", "true|/pt/categories/m%C3%BAsica/|") + b.AssertFileContent("public/pt/categories/música/index.html", "true|/en/categories/music/|") +} + // Issue #11540. func TestTranslationKeyResourceSharing(t *testing.T) { files := ` |