Only translate category

Hi,

I’m working with/in multilingual mode and I’m trying to translate my taxonomies like so:

German taxonomy structure:

domain.xy/de/tags/some-german-tag
domain.xy/de/kategorie/some-german-category

English taxonomy structure:
domain.xy/en/tags/some-english-tag
domain.xy/en/category/some-english-category

Due to the fact that tags are both the same in german and english, this doesn’t give me a problem
with

[taxonomies] tags = "tags"

I simply don’t want mixed languages/wrong translations in my url permalink structure.

I’ve tried playing around with the config.toml

from:
[taxonomies]
tags = “tags”
categories = “category”

to things like:
[taxonomies.de]
tags = “tags”
categories = “kategorie”
[taxonomies.en]
tags = “tags”
categories = “category”

Yet, I haven’t been able to find anything about it since most of the discussions are spinning around the taxonomy terms itself, which is not my problem - I’m fine with different slug in different languages - I’m just looking to keep my permalink symetry.

In case anyone has a link to a discussion or point me in the right direction, that would be nice.

Thanks.

site configuration

[languages.en]
contentDir = 'content/en'
languageCode = 'en-US'
languageName = 'English'
weight = 1

[languages.de]
contentDir = 'content/de'
languageCode = 'de-DE'
languageName = 'Deutsch'
weight = 2

[languages.de.permalinks]
categories = 'kategorien/:slug'

But the permalinks setting is applicable to regular pages, not list pages. So we also need to set the url on the list page:

content/de/categories/_index.md

+++
title = 'Kategorien'
date = 2022-09-13T14:12:51-07:00
draft = false
url = 'kategorien'
+++

Try it:

git clone --single-branch -b hugo-forum-topic-40498 https://github.com/jmooring/hugo-testing hugo-forum-topic-40498
cd hugo-forum-topic-40498
hugo server
4 Likes

Including git repository for me to clone and test :eyes:

I’m speechless.

@jmooring Woow, thank you so much - again.

This is exactly working the way I was trying to achive it.

Looking at your code, I do understand how to bypass the default behaviour.
I wasn’t aware of the trick with the folder and the _index.md + frontmatter url property.

Really great.

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