Skip to content

Multilingual & Internationalization (i18n)

Create a truly global site by customizing the interface language or translating your content into multiple languages. HugoBlox supports 35+ languages out of the box.

The interface language controls site text that isn’t part of your content (e.g., ā€œRead Moreā€, ā€œNext Pageā€).

  1. Configure Languages: Edit config/_default/languages.yaml to define which languages your site supports.
  2. Set Default: In hugo.yaml, set defaultContentLanguage to your primary language code (e.g., en, zh, es).

You can modify existing translations or create new language packs.

  1. Create the i18n Folder Create an i18n folder at your site root.

  2. Download or Create a File Download a language file (e.g., en.yaml) and save it to i18n/.

    • Directoryi18n/
      • en.yaml
      • zh.yaml
  3. Edit Translations Open the YAML file and modify the text strings.

Serve your content in multiple languages.

Organize your content/ folder using language codes.

  • Directorycontent/
    • Directoryen/
      • _index.md
      • Directoryposts/
        • my-post.md
    • Directoryzh/
      • _index.md
      • Directoryposts/
        • my-post.md
  1. Migrate Existing Content Move your default content into a subfolder named after its language code (e.g., content/en/).

  2. Create Translations Create parallel folders for other languages (e.g., content/zh/) and add translated Markdown files.

  3. Configure Content Directories Update config/_default/languages.yaml to map each language to its content directory.

You can create separate menus for each language.

  1. Default Menu: config/_default/menu.yaml
  2. Translated Menus: Create files like menu.zh.yaml or menu.es.yaml.

When a user switches languages, the corresponding menu will be displayed automatically.