{# mkdocs-static-i18n puts these variables on each page context. Every locale has the same page path below its own output directory, so changing only the locale prefix keeps the selector on the corresponding page (including a fallback page when no translation source exists). #} {%- if i18n_config is defined %} {%- set languages = i18n_config.languages | selectattr('build') | list %} {%- endif %} {%- if languages is defined and languages | length > 1 %} {%- set locales = namespace(default='') %} {%- for language in languages if language.default %} {%- set locales.default = language.locale %} {%- endfor %}
{%- for language in languages if language.locale == i18n_page_locale %} {{ language.name }} {%- endfor %}
{%- endif %}