Multilingual Mode

Luiz F. A. de Prá edited this page Sep 16, 2018 · 1 revision

WIP

To use multilingual mode, the configuration above needs to be extended by parameters for the specific languages. Each language section overrides default site's parameters when that language is chosen.

[params]
    author = "John Doe"

[languages]
    [languages.en]
        languagename = "English" # The language name to be displayed in the selector.
        title = "John Doe"

        # You can configure the theme parameter for each language. 
        [languages.en.params]
        info = "Full Stack DevOps and Magician"
        description = "John Doe's personal website"
        keywords = "blog,developer,personal"

        [languages.en.menu] # It is possible to change the menu too.

        [[languages.en.menu.main]]
        name = "About"
        weight = 1.0
        url = "/about/"

        [[languages.en.menu.main]]
        name = "Blog"
        weight = 2.0
        url = "/posts/"


    [languages.pl]
        languagename = "Polski"
        title = "John Doe po polsku"

        [languages.pl.params]
            description = "Strona domowa John'a Doe"
            keywords = "blog,developer,strona domowa"
            info = "Full Stack DevOps i Magik"

        [languages.pl.menu]

            [[languages.pl.menu.main]]
            name = "O mnie"
            weight = 1.0
            url = "/pl/about/"

            [[languages.pl.menu.main]]
            name = "Blog"
            weight = 2.0
            url = "/pl/posts/"

It is possible to force Hugo to render all default language content under the language code with defaultContentLanguageInSubdir = true. In this case, remember to update your menus URLs (i.e. /en/about/).

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.