Multilingual
The Relearn theme works with Hugo’s multilingual mode.
It supports many languages, including right-to-left languages.
Translation by File Name
Here’s how to make your site multilingual using translations by file name:
-
Set up languages in your
hugo.tomlfile:hugo. -
Duplicate your content files and add language codes to their file names:
- content
- log
- first-day
- _index.en.md
- _index.pir.md
- second-day
- index.en.md
- index.pir.md
- third-day.en.md
- third-day.pir.md
- _index.en.md
- _index.pir.md
- first-day
- _index.en.md
- _index.pir.md
- log
- themes
- hugo-theme-relearn
- …
- hugo-theme-relearn
- hugo.toml
- content
Translation by Content Directory
The theme also support translations by content directory which can be configured in a similar way.
-
Set up languages in your
hugo.tomlfile:hugo. -
Duplicate your content files into separate directories named by their language code:
- content
- en
- log
- first-day
- _index.md
- second-day
- index.md
- third-day.md
- _index.md
- first-day
- _index.md
- log
- pir
- log
- first-day
- _index.md
- second-day
- index.md
- third-day.md
- _index.md
- first-day
- _index.md
- log
- en
- themes
- hugo-theme-relearn
- …
- hugo-theme-relearn
- hugo.toml
- content
Search Settings
Check the search configuration for multilingual options.
Turn Off Language Switching
Option By default the theme shows a language switcher in the lower part of the menu.
If you want to have more control, where the language switcher is positioned or you want to configure a different icon, see the chapter on sidebar configuration.
To disable the language switcher set disableLanguageSwitchingButton=true