RemarqueCette page n’a pas encore été traduite en français, la version anglaise est donc utilisée. Envie de contribuer à la traduction ? Contribuer
The FreeCAD website and the Trigo theme support multiple languages using Hugo’s multilingual mode.
Enable multi-language
To make the Hugo project multi-language, configure the supported languages:
defaultContentLanguage: en
languages:
en:
label: English
weight: 1
fr:
label: Français
weight: 2
ja:
label: 日本語
weight: 3RemarqueBefore a new language is enabled, the main sections and navigation pages (Homepage, Features, Download, News, Community, Documentation and Donate) and the Theme strings must be translated.
Want to add a new language? Please use the provided feature issue template indicating who will translate and proof-read/review.
Manage content translations
Hugo supports multiple approaches to managing translations. The FreeCAD website currently uses the translation by content directory.
Translation by content directory
Each locale has its own content directory as configured by their contentDir parameter.
The current FreeCAD website configuration defined separate root content directories for each locale:
-
-
- _index.md ← / (English homepage)
-
- _index.md ← /docs/ (English docs section)
-
- _index.md ← / (French homepage)
-
- _index.md ← /docs/ (French docs section)
-
- _index.md ← / (Japanese homepage)
-
- _index.md ← /docs/ (Japanese docs section)
-
This allows to use content mounts in the project configuration, where missing translated content uses the default language site as fallback (i.e. en for English).
Translation by filename
Hugo also supports managing translations by filename. With a file content/docs/_index.en.md in English, the file content/docs/_index.fr.md contains the French translation. This approach is currently not used for the FreeCAD website.
-
- _index.en.md ← / (English homepage)
- _index.fr.md ← / (French homepage)
- _index.ja.md ← / (Japanese homepage)
-
- _index.en.md ← /docs/ (English docs section)
- _index.fr.md ← /docs/ (French docs section)
- _index.ja.md ← /docs/ (Japanese docs section)
Theme strings translations
To translate theme strings, i18n translation tables are used. YAML data files for each locale are stored in the i18n directory and define the string identifier and the translated value.
- id: title
translation: "Titre"