From d9b94850192554d4d7ef9d47e213997b79543833 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Thu, 22 Jan 2026 05:36:28 -0600 Subject: fix(app): a11y translations --- packages/ui/src/components/dialog.tsx | 4 +++- packages/ui/src/components/image-preview.tsx | 2 +- packages/ui/src/components/list.tsx | 2 +- packages/ui/src/components/popover.tsx | 4 +++- packages/ui/src/components/toast.tsx | 4 +++- 5 files changed, 11 insertions(+), 5 deletions(-) (limited to 'packages/ui/src/components') diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index 1b54739a2..83da6c699 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -1,5 +1,6 @@ import { Dialog as Kobalte } from "@kobalte/core/dialog" import { ComponentProps, JSXElement, Match, ParentProps, Show, Switch } from "solid-js" +import { useI18n } from "../context/i18n" import { IconButton } from "./icon-button" export interface DialogProps extends ParentProps { @@ -13,6 +14,7 @@ export interface DialogProps extends ParentProps { } export function Dialog(props: DialogProps) { + const i18n = useI18n() return (
@@ -45,7 +47,7 @@ export function Dialog(props: DialogProps) { as={IconButton} icon="close" variant="ghost" - aria-label="Close" + aria-label={i18n.t("ui.common.close")} /> diff --git a/packages/ui/src/components/image-preview.tsx b/packages/ui/src/components/image-preview.tsx index a09783fca..8462ce256 100644 --- a/packages/ui/src/components/image-preview.tsx +++ b/packages/ui/src/components/image-preview.tsx @@ -19,7 +19,7 @@ export function ImagePreview(props: ImagePreviewProps) { as={IconButton} icon="close" variant="ghost" - aria-label="Close" + aria-label={i18n.t("ui.common.close")} />
diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx index 9686b7bee..6a7f3a029 100644 --- a/packages/ui/src/components/list.tsx +++ b/packages/ui/src/components/list.tsx @@ -234,7 +234,7 @@ export function List(props: ListProps & { ref?: (ref: ListRef) => void }) icon="circle-x" variant="ghost" onClick={() => setInternalFilter("")} - aria-label="Clear filter" + aria-label={i18n.t("ui.list.clearFilter")} />
diff --git a/packages/ui/src/components/popover.tsx b/packages/ui/src/components/popover.tsx index 65c854e1f..6db44f5f9 100644 --- a/packages/ui/src/components/popover.tsx +++ b/packages/ui/src/components/popover.tsx @@ -1,5 +1,6 @@ import { Popover as Kobalte } from "@kobalte/core/popover" import { ComponentProps, JSXElement, ParentProps, Show, splitProps, ValidComponent } from "solid-js" +import { useI18n } from "../context/i18n" import { IconButton } from "./icon-button" export interface PopoverProps @@ -15,6 +16,7 @@ export interface PopoverProps } export function Popover(props: PopoverProps) { + const i18n = useI18n() const [local, rest] = splitProps(props, [ "trigger", "triggerAs", @@ -48,7 +50,7 @@ export function Popover(props: PopoverProps as={IconButton} icon="close" variant="ghost" - aria-label="Close" + aria-label={i18n.t("ui.common.close")} />
diff --git a/packages/ui/src/components/toast.tsx b/packages/ui/src/components/toast.tsx index bac6ff159..e8062a2a8 100644 --- a/packages/ui/src/components/toast.tsx +++ b/packages/ui/src/components/toast.tsx @@ -3,6 +3,7 @@ import type { ToastRootProps, ToastCloseButtonProps, ToastTitleProps, ToastDescr import type { ComponentProps, JSX } from "solid-js" import { Show } from "solid-js" import { Portal } from "solid-js/web" +import { useI18n } from "../context/i18n" import { Icon, type IconProps } from "./icon" import { IconButton } from "./icon-button" @@ -62,13 +63,14 @@ function ToastActions(props: ComponentProps<"div">) { } function ToastCloseButton(props: ToastCloseButtonProps & ComponentProps<"button">) { + const i18n = useI18n() return ( ) -- cgit v1.2.3