{#- This file was automatically generated - do not edit DocsForge deviation: the locale import resolves through the `lang_partial` context variable (see `resolve_lang_partial` in docsforge/templates.py). BCP 47 tags are case-insensitive, so a configured `zh-tw` must find the shipped `zh-TW.html`, and unknown locales must fall back to `en` — Jinja cannot catch a failed import, and the strict upstream form (`"partials/languages/" ~ page_lang ~ ".html"`) crashes the build. `page_lang` below is kept for the `` attribute. -#} {% set page_lang = config.theme.language %} {% if page is defined %} {% set locale = page.i18n_locale | default(none) %} {% if locale %} {% set page_lang = locale %} {% endif %} {% endif %} {% import (lang_partial | default("partials/languages/en.html", true)) as lang %} {% import "partials/languages/en.html" as fallback %} {% macro t(key) %}{{ lang.t(key) or fallback.t(key) or key }}{% endmacro %}