2024-10-07 15:30:53 +02:00
+++
2025-03-21 10:14:12 +01:00
categories = ['howto']
description = 'How to set up a multilingual site'
options = ['disableLanguageSwitchingButton']
title = 'Multilingual'
2024-10-07 15:30:53 +02:00
weight = 2
+++
The Relearn theme works with [Hugo's multilingual mode ](https://gohugo.io/content-management/multilingual/ ).
It supports many languages, including right-to-left languages.
{{% expand "Supported languages" %}}
- Arabic
- Simplified Chinese
- Traditional Chinese
- Czech
- Dutch
- English
- Finnish
- French
- German
- Hindi
- Hungarian
- Indonesian
- Italian
- Japanese
- Korean
2024-12-05 22:38:07 +03:30
- Persian
2024-10-07 15:30:53 +02:00
- Polish
- Portuguese
- Romanian
- Russian
- Spanish
- Swahili
- Turkish
2025-03-07 21:26:56 +01:00
- Ukrainian
2024-10-07 15:30:53 +02:00
- Vietnamese
{{% /expand %}}
## Translation by File Name
Here's how to make your site multilingual using [translations by file name ](https://gohugo.io/content-management/multilingual/#translation-by-file-name ):
1. Set up languages in your `hugo.toml` file:
{{< multiconfig file = hugo > }}
2024-10-12 18:37:59 +02:00
defaultContentLanguage = 'en'
2024-10-07 15:30:53 +02:00
[languages]
[languages.en]
weight = 1
2024-10-12 18:37:59 +02:00
languageName = 'English'
languageCode = 'en'
title = 'My Website'
2024-10-07 15:30:53 +02:00
[languages.pir]
weight = 2
2024-10-12 18:37:59 +02:00
languageName = 'Pirrratish'
languageCode = 'art-x-pir'
languageDirection = 'rtl'
title = 'Arrr, my Website'
2024-10-07 15:30:53 +02:00
{{< / multiconfig > }}
2. Duplicate your content files and add language codes to their file names:
2025-03-24 00:53:04 +01:00
````tree
- [PROJECT]
- content::folder
- log::folder
- first-day::folder
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.en.md::fa-fw fab fa-markdown::secondary
- index.pir.md::fa-fw fab fa-markdown::secondary
- third-day.en.md::fa-fw fab fa-markdown::secondary
- third-day.pir.md::fa-fw fab fa-markdown::secondary
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- themes::folder
- hugo-theme-relearn::folder
- ...::folder
- hugo.toml::file-alt::accent
2024-10-07 15:30:53 +02:00
````
## Translation by Content Directory
2025-02-14 00:07:05 +01:00
The theme also support [translations by content directory ](https://gohugo.io/content-management/multilingual/#translation-by-content-directory ) which can be configured in a similar way.
1. Set up languages in your `hugo.toml` file:
{{< multiconfig file = hugo > }}
defaultContentLanguage = 'en'
[languages]
[languages.en]
weight = 1
languageName = 'English'
languageCode = 'en'
contentDir = 'content/en'
title = 'My Website'
[languages.pir]
weight = 2
languageName = 'Pirrratish'
languageCode = 'art-x-pir'
languageDirection = 'rtl'
contentDir = 'content/pir'
title = 'Arrr, my Website'
{{< / multiconfig > }}
2. Duplicate your content files into separate directories named by their language code:
2025-03-24 00:53:04 +01:00
````tree
- [PROJECT]
- content::folder
- en::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- third-day.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- pir::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- third-day.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- themes::folder
- hugo-theme-relearn::folder
- ...::folder
- hugo.toml::file-alt::accent
2025-02-14 00:07:05 +01:00
````
2024-10-07 15:30:53 +02:00
## Search Settings
2024-10-12 10:52:54 +02:00
Check the [search configuration ](configuration/sidebar/search#mixed-language-support ) for multilingual options.
2024-10-07 15:30:53 +02:00
## Turn Off Language Switching
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} By default the theme shows a language switcher in the lower part of the menu.
2025-03-15 21:45:27 +01:00
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 ](configuration/sidebar/menus#defining-sidebar-menus ).
2024-10-07 15:30:53 +02:00
To disable the language switcher set `disableLanguageSwitchingButton=true`
2025-03-21 12:27:29 +01:00
{{< multiconfig file = hugo section = params > }}
disableLanguageSwitchingButton = true
2024-10-07 15:30:53 +02:00
{{< / multiconfig > }}