translationKey for Categories?

For Hugo with more than one language

Is it possible to link categories from different languages (like posts using translationKey) that do not share that same name?

For example, I got Category HUGO (in EN) as well HUGO (in PL) and they are linked nicely using <link rel="alternate" hreflang=.
But I got also HARDWARE (in EN), and the same category SPRZĘT (that means hardware, in PL).


Reference:

It would be easier if you could use the same term for all languages.

content/post/test.en.md

+++
title = 'Test (en)'
categories = ['foo']
+++

content/post/test.pl.md

+++
title = 'Test (pl)'
categories = ['foo']
+++

Then translate the title and url in the front matter of the term section page.

content/categories/foo/_index.en.md

+++
title = 'Foo'
+++

content/categories/foo/_index.pl.md

+++
title = 'Foo in Polish'
url = 'categories/foo-in-polish'
+++
2 Likes

Thank you, will have a look into that.

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