HUGO
Menu
GitHub 90437 stars Mastodon

hugo.IsMultilingual

Reports whether there are two or more configured languages.
Syntax
hugo.IsMultilingual
Returns
bool

Usage

The hugo.IsMultilingual function reports whether there are two or more configured languages.

Examples

This example uses this project configuration:

defaultContentLanguage: de
defaultContentLanguageInSubdir: true
languages:
  de:
    label: Deutsch
    locale: de-DE
    title: Projekt Dokumentation
    weight: 1
  en:
    label: English
    locale: en-US
    title: Project Documentation
    weight: 2
defaultContentLanguage = 'de'
defaultContentLanguageInSubdir = true
[languages]
  [languages.de]
    label = 'Deutsch'
    locale = 'de-DE'
    title = 'Projekt Dokumentation'
    weight = 1
  [languages.en]
    label = 'English'
    locale = 'en-US'
    title = 'Project Documentation'
    weight = 2
{
   "defaultContentLanguage": "de",
   "defaultContentLanguageInSubdir": true,
   "languages": {
      "de": {
         "label": "Deutsch",
         "locale": "de-DE",
         "title": "Projekt Dokumentation",
         "weight": 1
      },
      "en": {
         "label": "English",
         "locale": "en-US",
         "title": "Project Documentation",
         "weight": 2
      }
   }
}
{{ hugo.IsMultilingual }} → true