From 1353c316422c9d27103efbf06689a3e40360e8b3 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 3 May 2022 19:10:19 -0700 Subject: [PATCH] fix(list-box-selection): use default translations if `translateWithId` is undefined --- src/ListBox/ListBoxSelection.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ListBox/ListBoxSelection.svelte b/src/ListBox/ListBoxSelection.svelte index 93e755ec..317a300d 100644 --- a/src/ListBox/ListBoxSelection.svelte +++ b/src/ListBox/ListBoxSelection.svelte @@ -41,9 +41,12 @@ ctx.declareRef({ key: "selection", ref }); } - $: description = selectionCount - ? translateWithId("clearAll") - : translateWithId("clearSelection"); + $: translationId = selectionCount + ? translationIds.clearAll + : translationIds.clearSelection; + + $: description = + translateWithId?.(translationId) ?? defaultTranslations[translationId]; {#if selectionCount !== undefined}