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

This commit is contained in:
Elian Doran 2025-11-26 11:57:06 +02:00
parent 45d2e1f5e2
commit c65b03db41
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View File

@ -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",

View File

@ -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} />
</>
)
}