-
请选择您想学习的字符
+
{t("chooseCharacters")}
setChosenAlphabet("japanese")}>
- 日语假名
+ {t("japanese")}
setChosenAlphabet("english")}>
- 英文字母
+ {t("english")}
setChosenAlphabet("uyghur")}>
- 维吾尔字母
+ {t("uyghur")}
setChosenAlphabet("esperanto")}>
- 世界语字母
+ {t("esperanto")}
>
);
if (loadingState === "loading") {
- return "加载中...";
+ return t("loading");
}
if (loadingState === "error") {
- return "加载失败,请重试";
+ return t("loadFailed");
}
if (loadingState === "success" && alphabetData[chosenAlphabet]) {
return (
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 2af812a..cf04445 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import type { Viewport } from "next";
+import { NextIntlClientProvider } from "next-intl";
export const viewport: Viewport = {
width: "device-width",
@@ -23,7 +24,7 @@ export const metadata: Metadata = {
description: "A Website to Learn Languages",
};
-export default function RootLayout({
+export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
@@ -33,7 +34,7 @@ export default function RootLayout({
- {children}
+