feat: add internationalization message platform
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useId, type FormHTMLAttributes, type ReactNode } from "react";
|
||||
|
||||
import { TextField } from "../components/ui/text-field.jsx";
|
||||
import { useLocale } from "../i18n/index.js";
|
||||
import type {
|
||||
FieldErrors,
|
||||
FieldName,
|
||||
@@ -31,6 +32,7 @@ export function ErrorSummary<Values extends FormValues>(props: Readonly<{
|
||||
fieldId(name: FieldName<Values>): string;
|
||||
onFocusField?(name: FieldName<Values>): void;
|
||||
}>) {
|
||||
const { message } = useLocale();
|
||||
const {
|
||||
fieldErrors,
|
||||
formErrors = [],
|
||||
@@ -50,7 +52,7 @@ export function ErrorSummary<Values extends FormValues>(props: Readonly<{
|
||||
role="alert"
|
||||
aria-labelledby={headingId}
|
||||
>
|
||||
<h2 id={headingId}>입력 내용을 확인해 주세요.</h2>
|
||||
<h2 id={headingId}>{message("form.errorSummary")}</h2>
|
||||
{entries.length > 0 ? (
|
||||
<ul>
|
||||
{entries.map(([name, message]) => (
|
||||
|
||||
Reference in New Issue
Block a user