Internationalization¶
The theme has a built-in translation system for all UI strings.
Setting the language¶
extra:
language: en # en | es
Supported languages¶
| Code | Language |
|---|---|
en |
English (default) |
es |
Spanish / Español |
Adding a new language¶
Open themes/dap/main.html and find the i18n block (around line 40). Add a new {% elif %} branch:
{% elif lang == 'fr' %}
{% set _i18n.T = {
'search': 'Rechercher...',
'on_page': 'Sur cette page',
'prev': 'Précédent',
'next': 'Suivant',
'made_with': 'Généré avec',
'copy': 'Copier',
'copied': 'Copié !',
'light': 'Clair',
'dark': 'Sombre',
'accent': "Couleur d'accentuation",
'toggle_nav':'Ouvrir le menu',
'stars': 'étoiles',
'scheme': 'Schéma de couleurs'
} %}
Then set language: fr in mkdocs.yml.
Translated strings reference¶
| Key | Used in |
|---|---|
search |
Sidebar search input placeholder |
on_page |
Table of contents heading |
prev / next |
Page navigation buttons |
made_with |
Footer attribution |
copy / copied |
Code block copy button tooltip |
light / dark |
Theme panel scheme buttons |
accent |
Theme panel accent label |
toggle_nav |
Mobile hamburger button aria-label |
stars |
GitHub button stars aria-label |
scheme |
Theme panel section title |