I18n fallback translation

Just getting started with Hugo, and so far I’m loving it!

My site is international… I’ll be translating some, but not all content - some never, some will be delayed.

I understand that if use i18n strings and one isn’t translated it will fallback to the default language - which is great - but what about when I use translation within content - for example:


So in this case, I have three translations - the original in English and then French an German.

Now lets say I create a new page:


But for whatever reason I don’t create a German version - is it possible to get Hugo to fallback and generate a page in the default language - but still as newpage.de.md so that users don’t get a 404 when they visit the page navigating through the German version of the site?

Maybe I’ve missed something obvious here?!

All ideas welcome!

Thank you!

1 Like

What you ask for is not currently possible in Hugo, but I’m not sure I understand the requirement. You will only get a 404 if you actually link to that non-existing page, and if you do a .Site.RegularPages on the German site you will only get exsiting German pages. Also see the .Translations on each page; there should not be possible to get a link from Hugo’s objects that creates a 404. And it would seem a little odd if we created a English content page to replace a German one.

There is, however, a similar GitHub issue, that makes more sense to me. See:

As an added footnote:

In the latest Hugo, v0.25, you can also have templates per language (i.e. /layouts/index.de.html), and this also includes shortcodes, which is a big win for bigger multilingual sites.

Thanks for the prompt response - it’s been very helpful.

I’ve taken a look at https://github.com/gohugoio/hugo/issues/2529 and that is exactly what I am after… and written in a far more sensible way!

Yea, that issue is a good idea – and we should get to it, but I have to be honest and say that it is not on top of my priority list.


I’ve currently got a very similar use case for generating a user manual website. We have not created translations for every page in the manual, and would like the english versions of untranslated pages to still be available when viewing the manual in french or german.

Hi, Bep.
Latest version was added above case?

I found a solution using apache2 error handler:

RewriteEngine On
RewriteBase /
# Don't redirect if file, symlink or directoy exist
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# Redirect /lg/xxxxxx -> /xxxxxx
RewriteRule "^[a-z]{2}/(.*)$" "$1" [L,R=301]

I publish this code under public domain :wink:

This solution works but is not optimal, in my case I wanted to make kate-editor.org translatable (using gettext) but It would be a useless task for the KDE translators to translate all the content way back to 2004.

1 Like