We have a large site with 16 completely translated languages. Now we want to add a few strings in the English version which are not present in the other languages yet. My understanding from the docs on multilingual mode is that missing strings will fall back to the default language:
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
However, this doesn’t seem to work. The places where these strings should appear in the translations are just blank.
In a file in layouts/partial/
I call these with {{ .Site.Params.organisations.administrations }}
. This is a string which is only existing in the EN version, not any other translation.
My shortened config looks like this. The last few strings for the English language are not present in the German translation:
baseurl = "https://publiccode.eu"
title = "Public Money, Public Code"
theme = "hugo-creative-theme"
DefaultContentLanguage = "en"
# Static strings shared by all languages – these are not to be translated!
[params.static]
url = "https://publiccode.eu"
language = "Language"
[params.static.meta]
twitterUser = "@fsfe"
# === TRANSLATIONS ===
[Languages]
# == ENGLISH ==
# General strings
[Languages.en]
languageCode = "en"
languageName = "English"
description = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
[Languages.en.organisations]
headline = "Supporting Organisations"
administrations = "Administrations"
all = "All"
corporate = "Corporate"
international_ngo = "International NGOs"
national_ngo = "National NGOs"
regional_ngo = "Regional NGOs"
# == GERMAN ==
# General strings
[Languages.de]
languageCode = "de"
languageName = "Deutsch"
description = "Public Money, Public Code - Eine Kampagne, damit öffentlich finanzierte Software als Freie Software veröffentlicht wird"
[Languages.de.organisations]
headline = "Unterstützende Organisationen"
How can I make the fallback work? Thanks for any help!