This commit is contained in:
felixfontein 2024-11-14 05:21:56 +00:00
parent a6db821b3e
commit 96bccd6a36

View file

@ -1,6 +1,6 @@
const themeFlyoutDisplay = "hidden"; const themeFlyoutDisplay = "hidden";
const themeVersionSelector = "True"; const themeVersionSelector = true;
const themeLanguageSelector = "True"; const themeLanguageSelector = true;
if (themeFlyoutDisplay === "attached") { if (themeFlyoutDisplay === "attached") {
function renderLanguages(config) { function renderLanguages(config) {
@ -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"' : ""}>