Skip to content

Build your personal knowledge base with Trilium Notes

client: Translate dark/light color theme groups

Elian Dorancc0b3db42430
diff --git a/src/services/code_block_theme.ts b/src/services/code_block_theme.ts
index 9b7e3951c7..27f746d33d 100644
--- a/src/services/code_block_theme.ts
+++ b/src/services/code_block_theme.ts
@@ -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;
}
\ No newline at end of file
diff --git a/translations/en/server.json b/translations/en/server.json
index c5cb1c4f5e..3cf55e8f9b 100644
--- a/translations/en/server.json
+++ b/translations/en/server.json
@@ -185,6 +185,8 @@
"search_prefix": "Search:"
},
"code_block": {
- "theme_none": "None"
+ "theme_none": "None",
+ "theme_group_light": "Light themes",
+ "theme_group_dark": "Dark themes"
}
}
diff --git a/translations/ro/server.json b/translations/ro/server.json
index 7235ed4fa0..cad3bb9a36 100644
--- a/translations/ro/server.json
+++ b/translations/ro/server.json
@@ -185,6 +185,8 @@
"search_prefix": "Căutare:"
},
"code_block": {
- "theme_none": "Niciuna"
+ "theme_none": "Niciuna",
+ "theme_group_dark": "Teme întunecate",
+ "theme_group_light": "Teme luminoase"
}
}