Hugo supports internationalization (i18n), the content for each language is stored in a 2 or 3 char ISO 639 code.
Therefore documentation for a particular language will be found in /content/<lang>
, for example /content/fr
.
Any translations found are presented in a dropdown that will appear in the top right corner of the website and only for sections that are translated.
The primary documentation is written in English, and can therefore be found in content/en
In order to present the website in another language there are several things you need to do:
The new content simply goes in content/<lang>
. We recommend that the pages and file structure are the same as the English version.
In the site configuration, either in /config.toml
or in /config/
folder, add corresponding entries or files for the new language. For example
- Copy
menus.en.toml
tomenus.fr.toml
and translate whatever is needed into French
The underlying theme already supports i18n.
The theme itself (in the hugo-r3-theme repository) can be edited, but it is easier to take:
Copy /i18n/en.toml
to (site) /i18n/fr.toml
and then add the French translations.