Duplicated section templates when i18n problem


I have chosen to i18n my site with a directory per language. I have chosen to “localize” the section names in these directories. For instance I have two sections that deal with the same subject in different languages in these directories:


And of course “quelquechose” is the french translation of “something”

I now want to define a single template for this “subject”, spread in two directories. I can write a single template with all internal strings localised with the go-i18n function. But am I obliged to create two template files with the same content? These two files could be (as I understand):


Is there a way to tell Hugo that “something” section is the same as “quelquechose” section?

I understand that the other naming scheme of i18n files (ex subject.en.md and subject.fr.md) with slugs on section content and individual file content could solve my problem, but I prefer to have a directory per language.

Thank you

Disclaimer: I am not an expert on i18n with Hugo.

I think you can name the section in French something and then define it’s slug quelquechose in the front matter. Something as described here:

I remember having read something about translating sections via config.toml, but can’t find that post anymore.

Thank you for your answer.

I tried that solution after posting my question, but it does not completely work. Slug is taken into account in some places and is not in others. Maybe this have to do with the functions I use to retrieve the links to sections. I have to investigate further…

Do you have an _index.md inside of the content/fr/something/ folder where you define the slug? I think that might be the easiest solution because then you don’t need to add it to all subsequent files. Restart the server after this to go sure it has the new slug in all places. I noticed it sometimes “forgets” to update all locations.