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.
Interface Language
Section titled āInterface LanguageāThe interface language controls site text that isnāt part of your content (e.g., āRead Moreā, āNext Pageā).
Setting the Language
Section titled āSetting the Languageā- Configure Languages: Edit
config/_default/languages.yamlto define which languages your site supports. - Set Default: In
hugo.yaml, setdefaultContentLanguageto your primary language code (e.g.,en,zh,es).
Customizing Translations
Section titled āCustomizing TranslationsāYou can modify existing translations or create new language packs.
-
Create the i18n Folder Create an
i18nfolder at your site root. -
Download or Create a File Download a language file (e.g.,
en.yaml) and save it toi18n/.Directoryi18n/
- en.yaml
- zh.yaml
-
Edit Translations Open the YAML file and modify the text strings.
Multilingual Content
Section titled āMultilingual ContentāServe your content in multiple languages.
Directory Structure
Section titled āDirectory StructureāOrganize your content/ folder using language codes.
Directorycontent/
Directoryen/
- _index.md
Directoryposts/
- my-post.md
Directoryzh/
- _index.md
Directoryposts/
- my-post.md
-
Migrate Existing Content Move your default content into a subfolder named after its language code (e.g.,
content/en/). -
Create Translations Create parallel folders for other languages (e.g.,
content/zh/) and add translated Markdown files. -
Configure Content Directories Update
config/_default/languages.yamlto map each language to its content directory.
Multilingual Menus
Section titled āMultilingual MenusāYou can create separate menus for each language.
- Default Menu:
config/_default/menu.yaml - Translated Menus: Create files like
menu.zh.yamlormenu.es.yaml.
When a user switches languages, the corresponding menu will be displayed automatically.