HUGO

Multilingual Tag Links

My websites are bilingual. German (Default) and English. The English speaking websites are called with the addition /en/ - (http://localhost:1313/en/blabla). This works, including switch between languages, everything impeccably. Each website has frontmatter tags. Under /layouts/taxonomy/ I have a list.html and tag.html.

In the list.html I show a tag cloud with all tags. The tag.html is responsible for displaying all teasers of a tag. Everything works in German, but from an English website I come automatically when clicking on a tag on the German tag with German teasers.

It is clear to me that I miss one or several steps here. But I do not know how to solve this. Can someone help me?

Frank

I think you need german tags for the german content and english tags for the english content. I don’t know if there are any ways to get the current language content for the current tag somehow.

At the moment I have only multilingual tags. For example: hugo, svg, font, bootstrap. You do not need to translate. But that will come over time. That’s the next problem.

I am unable to reproduce the problem. It would be helpful if you could share the repository for your project.

Assume your posts in DE and EN got specified tags in both markdown files?
My (PL main, EN additional) using same scenario and Tags are separate for each language and I am using solo list.html/tags.html (not tags.en.html etc.) and don’t have issue.

Could you post your config file? and list.html and tags.html

Can I send you my project privately again? If that’s ok, I’ll email a link to Google Drive.

Yes, that would be fine.

Thanks for the answer. Mr. Mooring already knows my project. Will post the reason for failure here.

Many thanks to Joe Mooring. He found the bug. In the tag bar of the teaser and in the single view of the blog article I have

{{$ href := print(absURL “tags/”) (urlize .)}}

instead of

{{$ href := print(absLangURL “tags/”) (urlize .)}}

used for the tag link. As a result, everything worked, but when you click on a tag, the default language was displayed.

3 Likes

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