Hugo: Make sections (and taxonomies) multilingual

Created on 27 Feb 2020  路  5Comments  路  Source: gohugoio/hugo

The multilingualism in Hugo is great, but for one detail: I've not found how to give sections a different URL depending on the language.
(I saw that this feature was already requested in #3046 and #3047, but maybe now is a good time to reevaluate the blockers.)

  • I tried using the permalinks config, but multilingual doesn't apply to it like it does to the parameters.
  • I can change the section home page using url in the section's _index.lg.md's front matter, but it does not apply to sub nodes.

There _are_ solutions currently, that I deem highly unsatisfactory.

  • Specify a full url in nodes' front matters, which would short-fuse the purpose of permalinks.
  • Duplicate all sections according to language and use the translationKey, but it's difficult to make page bundles with shared resources in this case.

Actually multilingual permalinks and specifying /mysectiontranslation/:slug instead of /:section/slug would go a long way. Combined with url in the sections _index.lg.md, most cases would be covered, I think.

What's your take on this? Can I get a quickie about what prevents the implementation of multilingualism at the section level?

Most helpful comment

I also had to dig up many forum posts and github issues before finally landing here and finding cyChop's interesting link. Perhaps it would be worth adding to the documentation.

All 5 comments

We do support this per section and there are plenty of examples out there. There may be details here that does not work perfectly, but the normal use case works just fine. This feels like a question for the forum.

Sorry, I did not find these examples (I promise I did search and try things). I'll a dig a bit more.

I concur with you: if this is supported, it should not be registered as an issue. I'll close so as not to pollute your back log. Thank you!

For information, if anyone has a solution or is looking for one, I created a topic on Hugo's discourse.

I also had to dig up many forum posts and github issues before finally landing here and finding cyChop's interesting link. Perhaps it would be worth adding to the documentation.

You're correct. I'll leave myself a reminder to propose something if I have the time, but feel free to fork yourself if you're up to it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sigma picture sigma  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments

digitalcraftsman picture digitalcraftsman  路  3Comments

marekr picture marekr  路  3Comments

carandraug picture carandraug  路  3Comments