Skip to content

Build your personal knowledge base with Trilium Notes

chore(collections/list): use translations for expand depth

Elian Doranc65b03db4124
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 799c2a1d11..c1ad3fc288 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -767,6 +767,9 @@
"expand_all_children": "Expand all children",
"collapse": "Collapse",
"expand": "Expand",
+ "expand_first_level": "Expand direct children",
+ "expand_nth_level": "Expand {{depth}} levels",
+ "expand_all_levels": "Expand all levels",
"book_properties": "Collection Properties",
"invalid_view_type": "Invalid view type '{{type}}'",
"calendar": "Calendar",
diff --git a/apps/client/src/widgets/ribbon/collection-properties-config.tsx b/apps/client/src/widgets/ribbon/collection-properties-config.tsx
index c0827d8b2a..41cf352348 100644
--- a/apps/client/src/widgets/ribbon/collection-properties-config.tsx
+++ b/apps/client/src/widgets/ribbon/collection-properties-config.tsx
@@ -194,13 +194,13 @@ function ListExpandDepth(context: { note: FNote, parentComponent: Component }) {
return (
<>
- <ListExpandDepthButton label="Expand 1 level" depth={1} {...context} checked={currentDepth === ""} />
+ <ListExpandDepthButton label={t("book_properties.expand_first_level")} depth={1} {...context} checked={currentDepth === ""} />
<FormDropdownDivider />
{Array.from({ length: 4 }, (_, i) => i + 2).map(depth => [
- <ListExpandDepthButton label={`Expand ${depth} levels`} depth={depth} {...context} checked={!!currentDepth && parseInt(currentDepth, 10) === depth} />
+ <ListExpandDepthButton label={t("book_properties.expand_nth_level", { depth })} depth={depth} {...context} checked={!!currentDepth && parseInt(currentDepth, 10) === depth} />
])}
<FormDropdownDivider />
- <ListExpandDepthButton label="Expand all levels" depth="all" checked={currentDepth === "all"} {...context} />
+ <ListExpandDepthButton label={t("book_properties.expand_all_levels")} depth="all" checked={currentDepth === "all"} {...context} />
</>
)
}