feat: add internationalization message platform
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
|
||||
import { CloseIcon } from "../icons/semantic-icons.js";
|
||||
import { Button, Dialog, IconButton } from "./core.js";
|
||||
import { useLocale } from "../../i18n/index.js";
|
||||
|
||||
export type DrawerProps = Readonly<{
|
||||
open: boolean;
|
||||
@@ -343,9 +344,10 @@ function ToastRegion({
|
||||
toasts: readonly ToastEntry[];
|
||||
dismiss(id: string): void;
|
||||
}>) {
|
||||
const { message } = useLocale();
|
||||
return (
|
||||
<section
|
||||
aria-label="Notifications"
|
||||
aria-label={message("toast.region")}
|
||||
aria-live="polite"
|
||||
className="ui-toast-region"
|
||||
>
|
||||
@@ -363,6 +365,7 @@ function ToastItem({
|
||||
toast: ToastEntry;
|
||||
dismiss(id: string): void;
|
||||
}>) {
|
||||
const { message } = useLocale();
|
||||
const [paused, setPaused] = useState(false);
|
||||
useEffect(() => {
|
||||
if (paused) return;
|
||||
@@ -391,7 +394,7 @@ function ToastItem({
|
||||
{toast.description ? <p>{toast.description}</p> : null}
|
||||
</div>
|
||||
<IconButton
|
||||
accessibleName={`${toast.title} 닫기`}
|
||||
accessibleName={message("action.closeNamed", { title: toast.title })}
|
||||
onClick={() => dismiss(toast.id)}
|
||||
variant="ghost"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user