Multilingual
Qiandu supports creating multilingual websites using Hugo’s multilingual mode.
Enable multilingual support
In order for Qiandu to support your language, you need to tell Hugo which languages you need to support. Add this to Qiandu’s site configuration file:
hugo.yaml
defaultContentLanguage: en
languages:
en:
languageName: English
weight: 1
fr:
languageName: Français
weight: 2
ja:
languageName: 日本語
weight: 3
Manage translations by file name
Hugo supports managing translations by file name. For example, if we have an English file content/docs/_index.md
, we can create a file content/docs/_index.fr.md
translated to French.
- _index.md
- _index.fr.md
- _index.ja.md
Note: Hugo also supports managing translations by content directory.
Translate Menu Items
To translate menu items in the navigation bar, we need to set the identifier
field:
hugo.yaml
menu:
main:
- identifier: documentation
name: Documentation
pageRef: /docs
weight: 1
- identifier: blog
name: Blog
pageRef: /blog
weight: 2
Translate Strings
To translate strings elsewhere, we need to add the translations to the corresponding i18n
file:
i18n/fr.yaml
readMore: Lire la suite