Skip to content

Commit

Permalink
Attached flyout: show the current translation (#1629)
Browse files Browse the repository at this point in the history
* Attached flyout: show the current translation

Closes #1621

* Update sphinx_rtd_theme/static/js/versions.js_t
  • Loading branch information
humitos authored Nov 13, 2024
1 parent 5db7796 commit 17c0685
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx_rtd_theme/static/js/versions.js_t
Original file line number Diff line number Diff line change
Expand Up @@ -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"' : ""}>
Expand Down

0 comments on commit 17c0685

Please sign in to comment.