mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
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:
parent
5db7796b6e
commit
17c0685be9
@ -8,10 +8,14 @@ if (themeFlyoutDisplay === "attached") {
|
|||||||
return "";
|
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 = `
|
const languagesHTML = `
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{ _('Languages') }}</dt>
|
<dt>{{ _('Languages') }}</dt>
|
||||||
${config.projects.translations
|
${languages
|
||||||
.map(
|
.map(
|
||||||
(translation) => `
|
(translation) => `
|
||||||
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>
|
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>
|
||||||
|
Loading…
Reference in New Issue
Block a user