Multilingual
Th' Relearrrn theme works wit' Hugo’s multilingual mode.
It supports many languages, includ'n right-to-left languages.
Translat'n by File Name
Here’s how t' make yer ship multilingual us'n translat'ns by file name:
-
Set up languages 'n yer
hugo.toml
file:hugo.defaultContentLanguage = 'en' [languages] [languages.en] languageCode = 'en' languageName = 'English' title = 'My Website' weight = 1 [languages.pir] languageCode = 'art-x-pir' languageDirect'n = 'rtl' languageName = 'Pirrratish' title = 'Arrr, my Website' weight = 2
defaultContentLanguage: en languages: en: languageCode: en languageName: English title: My Website weight: 1 pir: languageCode: art-x-pir languageDirect'n: rtl languageName: Pirrratish title: Arrr, my Website weight: 2
{ "defaultContentLanguage": "en", "languages": { "en": { "languageCode": "en", "languageName": "English", "title": "My Website", "weight": 1 }, "pir": { "languageCode": "art-x-pir", "languageDirection": "rtl", "languageName": "Pirrratish", "title": "Arrr, my Website", "weight": 2 } } }
-
Duplicate yer rrrambl'n files an' add language codes t' their file names:
βββ rrrambl'n β βββ first-chapter β β βββ first-page | | | βββ _index.en.md | | | βββ _index.pir.md β β βββ second-page | | | βββ index.en.md | | | βββ index.pir.md β β βββ third-page.en.md β β βββ third-page.pir.md β βββ _index.en.md β βββ _index.pir.md βββ themes β βββ hugo-theme-relearn β βββ ... βββ hugo.toml
Translat'n by Rrrambl'n Directory
Th' theme also support translat'ns by rrrambl'n directory which can be configured 'n a similar way. This be not used 'n further examples o' this documentat'n.
Search Sett'ns
Check th' search configurat'n fer multilingual opt'ns.
Turn Off Language Switch'n
Opt'n By default th' theme shows a language switcher 'n th' lower part o' th' menu.
T' dis'ble th' language switcher set disableLanguageSwitchingButton=true
hugo.
[params]
disableLanguageSwitchingButton = true
params:
disableLanguageSwitchingButton: true
{
"params": {
"disableLanguageSwitchingButton": true
}
}