Attached flyout: show the current translation (#1629)

* Attached flyout: show the current translation

Closes #1621

* Update sphinx_rtd_theme/static/js/versions.js_t
This commit is contained in:
Manuel Kaufmann 2024-11-13 11:56:19 +01:00 committed by GitHub
parent 5db7796b6e
commit 17c0685be9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,10 +8,14 @@ if (themeFlyoutDisplay === "attached") {
return "";
}
// Insert the current language to the options on the selector
let languages = config.projects.translations.concat(config.projects.current);
languages = languages.sort((a, b) => a.language.name.localeCompare(b.language.name));
const languagesHTML = `
<dl>
<dt>{{ _('Languages') }}</dt>
${config.projects.translations
${languages
.map(
(translation) => `
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>