Languages and metadata
Content translations, interface labels and sharing metadata.
On this page
Content languages
Declare languages through Zola and create translated Markdown files such as
page.de.md and _index.de.md. Collection source paths use the primary source.
The theme resolves the current translation and its actual permalink.
title = "Acme"
default_language = "en"
[languages.de]
title = "Acme"
description = "Handbücher für das Acme-Projekt."
build_search_index = true
[extra.devlab.i18n]
show_switcher = true
rtl_languages = []
[extra.devlab.i18n.language_names]
en = "English"
de = "Deutsch"
Zola provides language-specific config.title and config.description. Set
those fields in every language table. Zola does not inherit their primary-language
values. They supply the header brand and site metadata when no brand override
is configured.
The header switcher displays a compact dropdown showing the current language
code and a chevron, opening a vertical list of available translations of the
current content. Available translations use names configured in language_names,
falling back to the language code. The active language is marked with
aria-current="page". The dropdown and its links work without JavaScript.
With JavaScript, it closes on Escape, an outside click, or when focus moves
outside the switcher. When a page has no alternative translations, the
switcher is hidden automatically.
Disable show_switcher to hide the control completely. Alternate hreflang
metadata remains available. Languages in rtl_languages use dir="rtl".
Interface catalog
English, German and Russian defaults live in theme.toml. Override individual keys:
[extra.devlab.i18n.translations.de]
search = "Durchsuchen"
toc = "Inhalt"
copy = "Code kopieren"
theme_dark = "Dunkles Design"
For another language, create its table. Regional codes such as ru-RU first
inherit the base-language catalog (ru), then apply the full-code catalog.
Missing keys retain the base-language value and ultimately fall back to English.
The same order applies to component defaults and nested download labels. For
example, a translations.ru.copy override is shared by Russian regional codes;
translations."ru-RU".copy overrides it only for ru-RU.
Page routes, lang, language-switcher links and search index filenames keep the
full configured code. Plain text remains escaped in HTML and attributes.
JavaScript controls receive the same catalog through their rendered data-*
attributes. Search configuration
describes the corresponding language modules.
| Group | Keys |
|---|---|
| Navigation | skip, main_navigation, mobile_navigation, main_mobile_navigation, docs_mobile_navigation, docs_sidebar, docs_section_toggle, breadcrumb, toc, previous, next, pagination, page, page_count, language_switcher |
| Menu | menu, menu_open, menu_close, menu_back, menu_docs |
| Search | search, search_placeholder, search_start, search_loading, search_retry, search_no_results, search_unavailable, search_results, search_results_count, search_more |
| Appearance | theme_light, theme_dark, theme_system |
| Reading | published, updated, post_authors, reading_time, author_feed, post_tags, post_navigation, newer_post, older_post, page_actions, last_updated, copy_link, link_copied, copy_link_failed, copy_link_success, copy_link_error, edit_page, feedback_prompt, report_issue |
| Code | copy, copied, copy_failed, copy_success, copy_error |
| Components | callout_info, callout_warning, callout_error, callout_tip, tabs_label, file_tree_label, timeline_done, timeline_active, timeline_planned, timeline_blocked, diagram_error |
| Other | announcement, announcement_dismiss, footer_links, not_found, not_found_description, go_home, not_found_hint, docs_sections, docs_pages, docs_pages_sections, docs_pagination |
Keep {title} in docs_section_toggle, {author} in author_feed, {shown} /
{count} in search counts, and {current} / {total} in page_count. Download labels
use the nested translations.<language>.downloads table. Local data-file
[labels] overrides it. Its complete keys and placeholders are in theme.toml.
Product names, navigation names, authored messages and component bodies belong
to content. Translate them in the corresponding Markdown or data file.
Component defaults
Callout titles, the accessible name of a tab group, file-tree captions, timeline status labels and diagram error messages use the page's language. English, Russian and German defaults are included. Other languages use the English fallback until their catalog provides the corresponding keys.
Override a repeated label once in the site configuration:
[extra.devlab.i18n.translations.ru]
callout_warning = "Важно"
timeline_active = "Сейчас в работе"
diagram_error = "Не удалось показать схему."
An explicit component title, label or error_message takes precedence over
the catalog. Authored content, tab names, filenames and timeline titles are
unchanged. Omitting a tab-group label, file-tree label or diagram error message
selects the localized default. Empty file-tree labels and diagram error messages
remain empty; an empty tab-group label retains the interactive control's existing
Tabs fallback. An empty callout title or timeline label selects the default.
The five components also accept content_lang when their default labels should
use a language different from the current page:
{% <devlab.file_tree content_lang="de"> %}
{{<devlab.file name="Cargo.toml" />}}
{% </devlab.file_tree> %}Metadata
Site defaults live in [extra.devlab.seo]. Page or section front matter can
override fields through [extra.devlab.seo]:
[extra.devlab.seo]
og_image = "/images/share.webp"
og_image_alt = "Preview of the product"
og_type = "website"
og_image defaults to empty. og_image_alt describes an existing sharing image.
Local paths respect base_url. Article layouts default to article. Ordinary
pages, landings, Docs and Reader default to website. og_type can explicitly
override the default. Title and description continue to come from content, with
site fallbacks. Canonical URLs use the generated route.