From 17c0685be9f7c032c454a6dd4110bfc3892b7e06 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 13 Nov 2024 11:56:19 +0100 Subject: [PATCH] Attached flyout: show the current translation (#1629) * Attached flyout: show the current translation Closes #1621 * Update sphinx_rtd_theme/static/js/versions.js_t --- sphinx_rtd_theme/static/js/versions.js_t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sphinx_rtd_theme/static/js/versions.js_t b/sphinx_rtd_theme/static/js/versions.js_t index fd8d91b0d..65bf148a2 100644 --- a/sphinx_rtd_theme/static/js/versions.js_t +++ b/sphinx_rtd_theme/static/js/versions.js_t @@ -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 = `
{{ _('Languages') }}
- ${config.projects.translations + ${languages .map( (translation) => `