From 2a4355113ba3f74642561b75e6707f00b6a7c718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio?= Date: Mon, 2 Nov 2020 11:10:24 +0200 Subject: [PATCH] Add example for regional language tags (#1139) * Add example for regional language tags * Typo fix --- content/en/content-management/multilingual.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 9987bca8c..036d74064 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -52,6 +52,10 @@ help = "Aide" title = "مدونتي" weight = 2 languagedirection = "rtl" + +[languages.pt-pt] +title = "O meu blog" +weight = 3 {{< /code-toggle >}} Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set. @@ -67,6 +71,8 @@ If the default language needs to be rendered below its own language code (`/en`) Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc. +**Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `DefaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344) + ### Disable a Language You can disable one or more languages. This can be useful when working on a new translation.