Navigation Translations
Translate navigation labels for multilingual Mordoc sites.
Navigation translations are only needed when your site has more than one language.
If your site only uses content/en/, you can skip this page for now and come back later.
What gets translated
Your navigation files define the structure of the navigation:
config/navigation/sidenav.yaml
config/navigation/topnav.yaml
config/navigation/headernav.yamlTranslation files let you change the visible labels for another language without rebuilding the whole navigation structure from scratch.
Create a translations folder
Navigation translation files live here:
config/navigation/translations/Create one YAML file for each translated language.
For example, a French translation file would be:
config/navigation/translations/fr.yamlAdd translated labels
Use the original labels as keys, then provide the translated labels as values:
Getting Started: Premiers pas
Writing Content: Rediger du contenu
Configuration: ConfigurationWhen Mordoc shows the French version of the site, it can use these translated labels in navigation.
Keep labels matched
The keys in the translation file should match the labels used in your navigation files.
For example, if sidenav.yaml contains:
- label: Getting Started
children:
- label: Create a Project
path: /getting-started/create-projectThen the translation file can contain:
Getting Started: Premiers pas
Create a Project: Creer un projetIf a label is missing from the translation file, Mordoc can still show the original label.
Start with languages first
Navigation translations make the most sense after your site has more than one language folder, such as:
content/
├── en/
└── fr/If you have not done that yet, start with Languages.