.IsTranslated is always false for nested List Files

I’m currently creating a multilingual blog, which also utilizes a tag system.

  • /tags/_index.de.md Lists all tags. .IsTranslated = true
  • /tags/<tagname>/_index.de.md Lists all blog entries with this tag. .IsTranslated = false - always
  • /tags/_index.en.md Lists all English tags. .IsTranslated = true
  • /tags/<tagname>/_index.en.md Lists all blog entries with this tag. .IsTranslated = false - always

I’ve already checked the settings multiple times, but there has been no progress. When I change the filename from /tags/<tagname>/_index.de.md to /tags/<tagname>/index.de.md, the pages are immediately translated.

Any ideas?

Hugo version?

Regardless of version, I am unable to reproduce the problem as described. Try it:

git clone --single-branch -b hugo-forum-topic-48849 https://github.com/jmooring/hugo-testing hugo-forum-topic-48849
cd hugo-forum-topic-48849
rm -rf public && hugo
cat public/de/tags/index.html
cat public/de/tags/foo/index.html
cat public/en/tags/index.html
cat public/en/tags/foo/index.html
PS C:\source\website> hugo version
hugo v0.123.8-5fed9c591b694f314e5939548e11cc3dcb79a79c+extended windows/amd64 BuildDate=2024-03-07T13:14:42Z VendorInfo=gohugoio

The example is not even slightly realistic compared to the case. I’ll push you an update. Inproper language

Thanks for the reproduction example, but one level is missing. I will extend it on this basis and send a PullRequest.

Send you a PR, for your test branch. With the broken .IsTranslated

I’m sorry. I tried to reproduce per your initial description.

That would be… helpful.

Break .IsTranslated by samtrion · Pull Request #5 · jmooring/hugo-testing (github.com)

Thanks for updating the test case… much appreciated.

Here are the test commands I run:

rm -rf public && hugo
cat public/de/tags/index.html
cat public/de/tags/foo/index.html
cat public/en/tags/index.html
cat public/en/tags/foo/index.html

Result with v0.123.8

Slug=tags
Language=de
IsTranslated=true

Slug=foo
Language=de
IsTranslated=false  <-- INCORRECT

Slug=tags
Language=en
IsTranslated=true

Slug=foo
Language=en
IsTranslated=false  <-- INCORRECT

Results with hugo v0.124.0-DEV-d4d49e0f:

Slug=tags
Language=de
IsTranslated=true

Slug=foo
Language=de
IsTranslated=true

Slug=tags
Language=en
IsTranslated=true

Slug=foo
Language=en
IsTranslated=true

So… this was fixed earlier today, presumably by https://github.com/gohugoio/hugo/pull/12262.

1 Like

Great to hear, is there already a plan when 0.124.0 will be shipped?

It may be v0.123.9… not sure. I imagine it will be released by the end of next week, probably a bit sooner.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.