client: Translate dark/light color theme groups

This commit is contained in:
Elian Doran
2024-10-31 21:00:48 +02:00
parent ae60f8c842
commit cc0b3db424
3 changed files with 14 additions and 9 deletions

View File

@@ -40,18 +40,19 @@ function readThemesFromFileSystem(path: string): ColorTheme[] {
}
function groupThemesByLightOrDark(listOfThemes: ColorTheme[]) {
const result: Record<string, ColorTheme[]> = {
light: [],
dark: []
};
const darkThemes = [];
const lightThemes = [];
for (const theme of listOfThemes) {
if (theme.title.includes("Dark")) {
result.dark.push(theme);
darkThemes.push(theme);
} else {
result.light.push(theme);
lightThemes.push(theme);
}
}
return result;
const output: Record<string, ColorTheme[]> = {};
output[t("code_block.theme_group_light")] = lightThemes;
output[t("code_block.theme_group_dark")] = darkThemes;
return output;
}