Skip to content

Latest commit

 

History

History
34 lines (17 loc) · 1.39 KB

i18n.md

File metadata and controls

34 lines (17 loc) · 1.39 KB

Internationalization

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.

Primary Documentation

The primary documentation is written in English, and can therefore be found in content/en

Translations

In order to present the website in another language there are several things you need to do:

Translate the content

The new content simply goes in content/<lang>. We recommend that the pages and file structure are the same as the English version.

Update Site configuration

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 to menus.fr.toml and translate whatever is needed into French

Update the Theme

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.