From 44bc99dd9db42ff27c42464536457dbcfe5c4770 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Sat, 31 May 2025 21:29:47 +0800 Subject: [PATCH] add: i18n --- .../fonts/InterFont/Inter-Black.woff2 | 0 .../fonts/InterFont/Inter-BlackItalic.woff2 | 0 .../fonts/InterFont/Inter-Bold.woff2 | 0 .../fonts/InterFont/Inter-BoldItalic.woff2 | 0 .../fonts/InterFont/Inter-ExtraBold.woff2 | 0 .../InterFont/Inter-ExtraBoldItalic.woff2 | 0 .../fonts/InterFont/Inter-ExtraLight.woff2 | 0 .../InterFont/Inter-ExtraLightItalic.woff2 | 0 .../fonts/InterFont/Inter-Italic.woff2 | 0 .../fonts/InterFont/Inter-Light.woff2 | 0 .../fonts/InterFont/Inter-LightItalic.woff2 | 0 .../fonts/InterFont/Inter-Medium.woff2 | 0 .../fonts/InterFont/Inter-MediumItalic.woff2 | 0 .../fonts/InterFont/Inter-Regular.woff2 | 0 .../fonts/InterFont/Inter-SemiBold.woff2 | 0 .../InterFont/Inter-SemiBoldItalic.woff2 | 0 .../fonts/InterFont/Inter-Thin.woff2 | 0 .../fonts/InterFont/Inter-ThinItalic.woff2 | 0 .../app/[locale]/fonts/InterFont/Inter.css | 449 +++++++++++++++++ .../fonts/InterFont/InterDisplay-Black.woff2 | 0 .../InterFont/InterDisplay-BlackItalic.woff2 | 0 .../fonts/InterFont/InterDisplay-Bold.woff2 | 0 .../InterFont/InterDisplay-BoldItalic.woff2 | 0 .../InterFont/InterDisplay-ExtraBold.woff2 | 0 .../InterDisplay-ExtraBoldItalic.woff2 | 0 .../InterFont/InterDisplay-ExtraLight.woff2 | 0 .../InterDisplay-ExtraLightItalic.woff2 | 0 .../fonts/InterFont/InterDisplay-Italic.woff2 | 0 .../fonts/InterFont/InterDisplay-Light.woff2 | 0 .../InterFont/InterDisplay-LightItalic.woff2 | 0 .../fonts/InterFont/InterDisplay-Medium.woff2 | 0 .../InterFont/InterDisplay-MediumItalic.woff2 | 0 .../InterFont/InterDisplay-Regular.woff2 | 0 .../InterFont/InterDisplay-SemiBold.woff2 | 0 .../InterDisplay-SemiBoldItalic.woff2 | 0 .../fonts/InterFont/InterDisplay-Thin.woff2 | 0 .../InterFont/InterDisplay-ThinItalic.woff2 | 0 .../InterFont/InterVariable-Italic.woff2 | 0 .../fonts/InterFont/InterVariable.woff2 | 0 .../fonts/MiSans/MiSans VF.woff2 | 0 .../fonts/MiSans/MiSans-Bold.woff2 | 0 .../fonts/MiSans/MiSans-Demibold.woff2 | 0 .../fonts/MiSans/MiSans-ExtraLight.woff2 | 0 .../fonts/MiSans/MiSans-Heavy.woff2 | 0 .../fonts/MiSans/MiSans-Light.woff2 | 0 .../fonts/MiSans/MiSans-Medium.woff2 | 0 .../fonts/MiSans/MiSans-Normal.woff2 | 0 .../fonts/MiSans/MiSans-Regular.woff2 | 0 .../fonts/MiSans/MiSans-Semibold.woff2 | 0 .../fonts/MiSans/MiSans-Thin.woff2 | 0 .../next/app/[locale]/fonts/MiSans/MiSans.css | 87 ++++ packages/next/app/{ => [locale]}/globals.css | 6 +- packages/next/app/{ => [locale]}/layout.tsx | 19 +- packages/next/app/{ => [locale]}/page.tsx | 0 .../app/{ => [locale]}/signup/SignUpForm.tsx | 50 +- .../next/app/{ => [locale]}/signup/page.tsx | 4 +- packages/next/app/fonts/InterFont/Inter.css | 450 ------------------ packages/next/app/fonts/MiSans/MiSans.css | 88 ---- packages/next/bun.lock | 30 ++ packages/next/components/ui/Dialog.tsx | 23 +- packages/next/i18n/navigation.ts | 6 + packages/next/i18n/request.ts | 21 + packages/next/i18n/routing.ts | 9 + packages/next/i18n/strings/en.json | 6 + packages/next/i18n/strings/zh.json | 10 + packages/next/lib/middleware.ts | 11 + packages/next/next.config.ts | 5 +- packages/next/package.json | 2 + 68 files changed, 709 insertions(+), 567 deletions(-) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Black.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-BlackItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Bold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-BoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-ExtraBold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-ExtraBoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-ExtraLight.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-ExtraLightItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Italic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Light.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-LightItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Medium.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-MediumItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Regular.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-SemiBold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-SemiBoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-Thin.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/Inter-ThinItalic.woff2 (100%) create mode 100644 packages/next/app/[locale]/fonts/InterFont/Inter.css rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Black.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-BlackItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Bold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-BoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-ExtraBold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-ExtraBoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-ExtraLight.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-ExtraLightItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Italic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Light.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-LightItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Medium.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-MediumItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Regular.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-SemiBold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-SemiBoldItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-Thin.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterDisplay-ThinItalic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterVariable-Italic.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/InterFont/InterVariable.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans VF.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Bold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Demibold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-ExtraLight.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Heavy.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Light.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Medium.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Normal.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Regular.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Semibold.woff2 (100%) rename packages/next/app/{ => [locale]}/fonts/MiSans/MiSans-Thin.woff2 (100%) create mode 100644 packages/next/app/[locale]/fonts/MiSans/MiSans.css rename packages/next/app/{ => [locale]}/globals.css (95%) rename packages/next/app/{ => [locale]}/layout.tsx (50%) rename packages/next/app/{ => [locale]}/page.tsx (100%) rename packages/next/app/{ => [locale]}/signup/SignUpForm.tsx (82%) rename packages/next/app/{ => [locale]}/signup/page.tsx (86%) delete mode 100644 packages/next/app/fonts/InterFont/Inter.css delete mode 100644 packages/next/app/fonts/MiSans/MiSans.css create mode 100644 packages/next/i18n/navigation.ts create mode 100644 packages/next/i18n/request.ts create mode 100644 packages/next/i18n/routing.ts create mode 100644 packages/next/i18n/strings/en.json create mode 100644 packages/next/i18n/strings/zh.json create mode 100644 packages/next/lib/middleware.ts diff --git a/packages/next/app/fonts/InterFont/Inter-Black.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Black.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Black.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Black.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-BlackItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-BlackItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-BlackItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-BlackItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Bold.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Bold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Bold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Bold.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-BoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-BoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-BoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-BoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-ExtraBold.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-ExtraBold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-ExtraBold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-ExtraBold.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-ExtraBoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-ExtraBoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-ExtraBoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-ExtraBoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-ExtraLight.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-ExtraLight.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-ExtraLight.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-ExtraLight.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-ExtraLightItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-ExtraLightItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-ExtraLightItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-ExtraLightItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Italic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Italic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Italic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Italic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Light.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Light.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Light.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Light.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-LightItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-LightItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-LightItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-LightItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Medium.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Medium.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Medium.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Medium.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-MediumItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-MediumItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-MediumItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-MediumItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Regular.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Regular.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Regular.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Regular.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-SemiBold.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-SemiBold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-SemiBold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-SemiBold.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-SemiBoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-SemiBoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-SemiBoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-SemiBoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-Thin.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-Thin.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-Thin.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-Thin.woff2 diff --git a/packages/next/app/fonts/InterFont/Inter-ThinItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/Inter-ThinItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/Inter-ThinItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/Inter-ThinItalic.woff2 diff --git a/packages/next/app/[locale]/fonts/InterFont/Inter.css b/packages/next/app/[locale]/fonts/InterFont/Inter.css new file mode 100644 index 0000000..187cd75 --- /dev/null +++ b/packages/next/app/[locale]/fonts/InterFont/Inter.css @@ -0,0 +1,449 @@ +@font-face { + font-family: "Inter Variable"; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url("InterVariable.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter Variable"; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url("InterVariable-Italic.woff2") format("woff2"); +} + +/* static fonts */ +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url("Inter-Thin.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url("Inter-ThinItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url("Inter-ExtraLight.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url("Inter-ExtraLightItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url("Inter-Light.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url("Inter-LightItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("Inter-Regular.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("Inter-Italic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url("Inter-Medium.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url("Inter-MediumItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url("Inter-SemiBold.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url("Inter-SemiBoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("Inter-Bold.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("Inter-BoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url("Inter-ExtraBold.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url("Inter-ExtraBoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url("Inter-Black.woff2") format("woff2"); +} + +@font-face { + font-family: "Inter"; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url("Inter-BlackItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url("InterDisplay-Thin.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url("InterDisplay-ThinItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url("InterDisplay-ExtraLight.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url("InterDisplay-ExtraLightItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url("InterDisplay-Light.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url("InterDisplay-LightItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("InterDisplay-Regular.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("InterDisplay-Italic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url("InterDisplay-Medium.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url("InterDisplay-MediumItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url("InterDisplay-SemiBold.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url("InterDisplay-SemiBoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("InterDisplay-Bold.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("InterDisplay-BoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url("InterDisplay-ExtraBold.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url("InterDisplay-ExtraBoldItalic.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url("InterDisplay-Black.woff2") format("woff2"); +} + +@font-face { + font-family: "InterDisplay"; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url("InterDisplay-BlackItalic.woff2") format("woff2"); +} + +@font-feature-values InterVariable { + @character-variant { + cv01: 1; + cv02: 2; + cv03: 3; + cv04: 4; + cv05: 5; + cv06: 6; + cv07: 7; + cv08: 8; + cv09: 9; + cv10: 10; + cv11: 11; + cv12: 12; + cv13: 13; + alt-1: 1; /* Alternate one */ + alt-3: 9; /* Flat-top three */ + open-4: 2; /* Open four */ + open-6: 3; /* Open six */ + open-9: 4; /* Open nine */ + lc-l-with-tail: 5; /* Lower-case L with tail */ + simplified-u: 6; /* Simplified u */ + alt-double-s: 7; /* Alternate German double s */ + uc-i-with-serif: 8; /* Upper-case i with serif */ + uc-g-with-spur: 10; /* Capital G with spur */ + single-story-a: 11; /* Single-story a */ + compact-lc-f: 12; /* Compact f */ + compact-lc-t: 13; /* Compact t */ + } + @styleset { + ss01: 1; + ss02: 2; + ss03: 3; + ss04: 4; + ss05: 5; + ss06: 6; + ss07: 7; + ss08: 8; + open-digits: 1; /* Open digits */ + disambiguation: 2; /* Disambiguation (with zero) */ + disambiguation-except-zero: 4; /* Disambiguation (no zero) */ + round-quotes-and-commas: 3; /* Round quotes & commas */ + square-punctuation: 7; /* Square punctuation */ + square-quotes: 8; /* Square quotes */ + circled-characters: 5; /* Circled characters */ + squared-characters: 6; /* Squared characters */ + } +} +@font-feature-values Inter { + @character-variant { + cv01: 1; + cv02: 2; + cv03: 3; + cv04: 4; + cv05: 5; + cv06: 6; + cv07: 7; + cv08: 8; + cv09: 9; + cv10: 10; + cv11: 11; + cv12: 12; + cv13: 13; + alt-1: 1; /* Alternate one */ + alt-3: 9; /* Flat-top three */ + open-4: 2; /* Open four */ + open-6: 3; /* Open six */ + open-9: 4; /* Open nine */ + lc-l-with-tail: 5; /* Lower-case L with tail */ + simplified-u: 6; /* Simplified u */ + alt-double-s: 7; /* Alternate German double s */ + uc-i-with-serif: 8; /* Upper-case i with serif */ + uc-g-with-spur: 10; /* Capital G with spur */ + single-story-a: 11; /* Single-story a */ + compact-lc-f: 12; /* Compact f */ + compact-lc-t: 13; /* Compact t */ + } + @styleset { + ss01: 1; + ss02: 2; + ss03: 3; + ss04: 4; + ss05: 5; + ss06: 6; + ss07: 7; + ss08: 8; + open-digits: 1; /* Open digits */ + disambiguation: 2; /* Disambiguation (with zero) */ + disambiguation-except-zero: 4; /* Disambiguation (no zero) */ + round-quotes-and-commas: 3; /* Round quotes & commas */ + square-punctuation: 7; /* Square punctuation */ + square-quotes: 8; /* Square quotes */ + circled-characters: 5; /* Circled characters */ + squared-characters: 6; /* Squared characters */ + } +} +@font-feature-values InterDisplay { + @character-variant { + cv01: 1; + cv02: 2; + cv03: 3; + cv04: 4; + cv05: 5; + cv06: 6; + cv07: 7; + cv08: 8; + cv09: 9; + cv10: 10; + cv11: 11; + cv12: 12; + cv13: 13; + alt-1: 1; /* Alternate one */ + alt-3: 9; /* Flat-top three */ + open-4: 2; /* Open four */ + open-6: 3; /* Open six */ + open-9: 4; /* Open nine */ + lc-l-with-tail: 5; /* Lower-case L with tail */ + simplified-u: 6; /* Simplified u */ + alt-double-s: 7; /* Alternate German double s */ + uc-i-with-serif: 8; /* Upper-case i with serif */ + uc-g-with-spur: 10; /* Capital G with spur */ + single-story-a: 11; /* Single-story a */ + compact-lc-f: 12; /* Compact f */ + compact-lc-t: 13; /* Compact t */ + } + @styleset { + ss01: 1; + ss02: 2; + ss03: 3; + ss04: 4; + ss05: 5; + ss06: 6; + ss07: 7; + ss08: 8; + open-digits: 1; /* Open digits */ + disambiguation: 2; /* Disambiguation (with zero) */ + disambiguation-except-zero: 4; /* Disambiguation (no zero) */ + round-quotes-and-commas: 3; /* Round quotes & commas */ + square-punctuation: 7; /* Square punctuation */ + square-quotes: 8; /* Square quotes */ + circled-characters: 5; /* Circled characters */ + squared-characters: 6; /* Squared characters */ + } +} diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Black.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Black.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Black.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Black.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-BlackItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-BlackItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-BlackItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-BlackItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Bold.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Bold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Bold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Bold.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-BoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-BoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-BoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-BoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-ExtraBold.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraBold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-ExtraBold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraBold.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-ExtraBoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraBoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-ExtraBoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraBoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-ExtraLight.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraLight.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-ExtraLight.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraLight.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-ExtraLightItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraLightItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-ExtraLightItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-ExtraLightItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Italic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Italic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Italic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Italic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Light.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Light.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Light.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Light.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-LightItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-LightItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-LightItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-LightItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Medium.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Medium.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Medium.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Medium.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-MediumItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-MediumItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-MediumItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-MediumItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Regular.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Regular.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Regular.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Regular.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-SemiBold.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-SemiBold.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-SemiBold.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-SemiBold.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-SemiBoldItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-SemiBoldItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-SemiBoldItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-SemiBoldItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-Thin.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-Thin.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-Thin.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-Thin.woff2 diff --git a/packages/next/app/fonts/InterFont/InterDisplay-ThinItalic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterDisplay-ThinItalic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterDisplay-ThinItalic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterDisplay-ThinItalic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterVariable-Italic.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterVariable-Italic.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterVariable-Italic.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterVariable-Italic.woff2 diff --git a/packages/next/app/fonts/InterFont/InterVariable.woff2 b/packages/next/app/[locale]/fonts/InterFont/InterVariable.woff2 similarity index 100% rename from packages/next/app/fonts/InterFont/InterVariable.woff2 rename to packages/next/app/[locale]/fonts/InterFont/InterVariable.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans VF.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans VF.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans VF.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans VF.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Bold.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Bold.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Bold.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Bold.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Demibold.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Demibold.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Demibold.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Demibold.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-ExtraLight.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-ExtraLight.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-ExtraLight.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-ExtraLight.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Heavy.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Heavy.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Heavy.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Heavy.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Light.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Light.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Light.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Light.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Medium.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Medium.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Medium.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Medium.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Normal.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Normal.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Normal.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Normal.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Regular.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Regular.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Regular.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Regular.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Semibold.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Semibold.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Semibold.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Semibold.woff2 diff --git a/packages/next/app/fonts/MiSans/MiSans-Thin.woff2 b/packages/next/app/[locale]/fonts/MiSans/MiSans-Thin.woff2 similarity index 100% rename from packages/next/app/fonts/MiSans/MiSans-Thin.woff2 rename to packages/next/app/[locale]/fonts/MiSans/MiSans-Thin.woff2 diff --git a/packages/next/app/[locale]/fonts/MiSans/MiSans.css b/packages/next/app/[locale]/fonts/MiSans/MiSans.css new file mode 100644 index 0000000..1d42290 --- /dev/null +++ b/packages/next/app/[locale]/fonts/MiSans/MiSans.css @@ -0,0 +1,87 @@ +@font-face { + font-family: "MiSans VF"; + font-style: normal; + font-weight: 150 700; + font-display: swap; + src: url("MiSans VF.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url("MiSans-Thin.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url("MiSans-ExtraLight.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url("MiSans-Light.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 360; + font-display: swap; + src: url("MiSans-Normal.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("MiSans-Regular.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url("MiSans-Medium.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url("MiSans-Demibold.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("MiSans-Semibold.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url("MiSans-Bold.woff2") format("woff2"); +} + +@font-face { + font-family: "MiSans"; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url("MiSans-Heavy.woff2") format("woff2"); +} diff --git a/packages/next/app/globals.css b/packages/next/app/[locale]/globals.css similarity index 95% rename from packages/next/app/globals.css rename to packages/next/app/[locale]/globals.css index 0b12f9a..57d07a6 100644 --- a/packages/next/app/globals.css +++ b/packages/next/app/[locale]/globals.css @@ -79,8 +79,6 @@ --color-dark-on-error: #690005; --color-dark-error-container: #93000a; --color-dark-on-error-container: #ffdad6; - - --font-zh: "InterVariable", "MiSans VF", sans-serif; } a { @@ -88,7 +86,7 @@ a { } :root { - font-family: "MiSans", "Inter", sans-serif; + font-family: "Inter", "MiSans", sans-serif; font-weight: 400; @apply bg-surface dark:bg-dark-surface text-on-surface dark:text-dark-on-surface; } @@ -101,7 +99,7 @@ a { @supports (font-variation-settings: normal) { :root { - font-family: "InterVariable", "MiSans VF", sans-serif; + font-family: "Inter Variable", "MiSans VF", sans-serif; font-optical-sizing: auto; font-weight: 330; } diff --git a/packages/next/app/layout.tsx b/packages/next/app/[locale]/layout.tsx similarity index 50% rename from packages/next/app/layout.tsx rename to packages/next/app/[locale]/layout.tsx index 25738da..3fe76e8 100644 --- a/packages/next/app/layout.tsx +++ b/packages/next/app/[locale]/layout.tsx @@ -1,16 +1,25 @@ import type { Metadata } from "next"; import "./globals.css"; import React from "react"; +import { routing } from "@/i18n/routing"; +import { NextIntlClientProvider, hasLocale } from "next-intl"; +import { notFound } from "next/navigation"; export const metadata: Metadata = { title: "中V档案馆" }; -export default function RootLayout({ - children +export default async function RootLayout({ + children, + params }: Readonly<{ children: React.ReactNode; + params: Promise<{ locale: string }>; }>) { + const { locale } = await params; + if (!hasLocale(routing.locales, locale)) { + notFound(); + } return ( @@ -19,8 +28,10 @@ export default function RootLayout({ 中V档案馆 - {children} -
+ + {children} +
+
); diff --git a/packages/next/app/page.tsx b/packages/next/app/[locale]/page.tsx similarity index 100% rename from packages/next/app/page.tsx rename to packages/next/app/[locale]/page.tsx diff --git a/packages/next/app/signup/SignUpForm.tsx b/packages/next/app/[locale]/signup/SignUpForm.tsx similarity index 82% rename from packages/next/app/signup/SignUpForm.tsx rename to packages/next/app/[locale]/signup/SignUpForm.tsx index 5480742..8341f55 100644 --- a/packages/next/app/signup/SignUpForm.tsx +++ b/packages/next/app/[locale]/signup/SignUpForm.tsx @@ -10,8 +10,28 @@ import { Portal } from "@/components/utils/Portal"; import { Dialog, DialogButton, DialogButtonGroup, DialogHeadline, DialogSupportingText } from "@/components/ui/Dialog"; import { FilledButton } from "@/components/ui/Buttons/FilledButton"; import { string, object, ValidationError } from "yup"; +import { setLocale } from "yup"; +import { useTranslations } from "next-intl"; -const FormSchema = object({ +setLocale({ + mixed: { + default: "field_invalid", + required: () => ({ key: "field_required" }) + }, + string: { + min: ({ min }) => ({ key: "field_too_short", values: { min } }), + max: ({ max }) => ({ key: "field_too_big", values: { max } }) + } +}); + +interface LocalizedMessage { + key: string; + values: { + [key: string]: number | string; + }; +} + +const FormSchema = object().shape({ username: string().required().max(50), password: string().required().min(4).max(120), nickname: string().optional().max(30) @@ -50,6 +70,7 @@ const SignUpForm: React.FC = ({ backendURL }) => { const [loading, setLoading] = useState(false); const [showDialog, setShowDialog] = useState(false); const [dialogContent, setDialogContent] = useState(<>); + const t = useTranslations(""); const { data: captchaSession, @@ -74,16 +95,26 @@ const SignUpForm: React.FC = ({ backendURL }) => { return fetcher(url.toString()); }; + const translateErrorMessage = (item: LocalizedMessage | string, path?: string) => { + if (typeof item === "string") { + return item; + } + return t(`yup_errors.${item.key}`, { ...item.values, field: path ? t(path) : "" }); + }; + const register = async () => { let username: string | undefined; let password: string | undefined; let nickname: string | undefined; try { - const formData = await FormSchema.validate({ - username: usernameInput, - password: passwordInput, - nickname: nicknameInput - }); + const formData = await FormSchema.validate( + { + username: usernameInput, + password: passwordInput, + nickname: nicknameInput + }, + { abortEarly: false } + ); username = formData.username; password = formData.password; nickname = formData.nickname; @@ -91,6 +122,7 @@ const SignUpForm: React.FC = ({ backendURL }) => { if (!(e instanceof ValidationError)) { return; } + console.log(JSON.parse(JSON.stringify(e))); setShowDialog(true); setDialogContent( <> @@ -99,14 +131,14 @@ const SignUpForm: React.FC = ({ backendURL }) => {

注册信息填写有误,请检查后重新提交。

错误信息:
-
    +
      {e.errors.map((item, i) => { - return
    1. {item}
    2. ; + return
    3. {translateErrorMessage(item, e.inner[i].path)}
    4. ; })}
    - setShowDialog(false)}>Close + setShowDialog(false)}>关闭 ); diff --git a/packages/next/app/signup/page.tsx b/packages/next/app/[locale]/signup/page.tsx similarity index 86% rename from packages/next/app/signup/page.tsx rename to packages/next/app/[locale]/signup/page.tsx index b2906ec..620e013 100644 --- a/packages/next/app/signup/page.tsx +++ b/packages/next/app/[locale]/signup/page.tsx @@ -4,10 +4,10 @@ import SignUpForm from "./SignUpForm"; export default function SignupPage() { return ( -
    +

    diff --git a/packages/next/app/fonts/InterFont/Inter.css b/packages/next/app/fonts/InterFont/Inter.css deleted file mode 100644 index 81a1a16..0000000 --- a/packages/next/app/fonts/InterFont/Inter.css +++ /dev/null @@ -1,450 +0,0 @@ -@font-face { - font-family: InterVariable; - font-style: normal; - font-weight: 100 900; - font-display: swap; - src: url("InterVariable.woff2") format("woff2"); -} - -@font-face { - font-family: InterVariable; - font-style: italic; - font-weight: 100 900; - font-display: swap; - src: url("InterVariable-Italic.woff2") format("woff2"); -} - -/* static fonts */ -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 100; - font-display: swap; - src: url("Inter-Thin.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 100; - font-display: swap; - src: url("Inter-ThinItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 200; - font-display: swap; - src: url("Inter-ExtraLight.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 200; - font-display: swap; - src: url("Inter-ExtraLightItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url("Inter-Light.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 300; - font-display: swap; - src: url("Inter-LightItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url("Inter-Regular.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 400; - font-display: swap; - src: url("Inter-Italic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url("Inter-Medium.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 500; - font-display: swap; - src: url("Inter-MediumItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: url("Inter-SemiBold.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 600; - font-display: swap; - src: url("Inter-SemiBoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url("Inter-Bold.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 700; - font-display: swap; - src: url("Inter-BoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 800; - font-display: swap; - src: url("Inter-ExtraBold.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 800; - font-display: swap; - src: url("Inter-ExtraBoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: normal; - font-weight: 900; - font-display: swap; - src: url("Inter-Black.woff2") format("woff2"); -} - -@font-face { - font-family: "Inter"; - font-style: italic; - font-weight: 900; - font-display: swap; - src: url("Inter-BlackItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 100; - font-display: swap; - src: url("InterDisplay-Thin.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 100; - font-display: swap; - src: url("InterDisplay-ThinItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 200; - font-display: swap; - src: url("InterDisplay-ExtraLight.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 200; - font-display: swap; - src: url("InterDisplay-ExtraLightItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url("InterDisplay-Light.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 300; - font-display: swap; - src: url("InterDisplay-LightItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url("InterDisplay-Regular.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 400; - font-display: swap; - src: url("InterDisplay-Italic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url("InterDisplay-Medium.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 500; - font-display: swap; - src: url("InterDisplay-MediumItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: url("InterDisplay-SemiBold.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 600; - font-display: swap; - src: url("InterDisplay-SemiBoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url("InterDisplay-Bold.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 700; - font-display: swap; - src: url("InterDisplay-BoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 800; - font-display: swap; - src: url("InterDisplay-ExtraBold.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 800; - font-display: swap; - src: url("InterDisplay-ExtraBoldItalic.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: normal; - font-weight: 900; - font-display: swap; - src: url("InterDisplay-Black.woff2") format("woff2"); -} - -@font-face { - font-family: "InterDisplay"; - font-style: italic; - font-weight: 900; - font-display: swap; - src: url("InterDisplay-BlackItalic.woff2") format("woff2"); -} - -@font-feature-values InterVariable { - @character-variant { - cv01: 1; - cv02: 2; - cv03: 3; - cv04: 4; - cv05: 5; - cv06: 6; - cv07: 7; - cv08: 8; - cv09: 9; - cv10: 10; - cv11: 11; - cv12: 12; - cv13: 13; - alt-1: 1; /* Alternate one */ - alt-3: 9; /* Flat-top three */ - open-4: 2; /* Open four */ - open-6: 3; /* Open six */ - open-9: 4; /* Open nine */ - lc-l-with-tail: 5; /* Lower-case L with tail */ - simplified-u: 6; /* Simplified u */ - alt-double-s: 7; /* Alternate German double s */ - uc-i-with-serif: 8; /* Upper-case i with serif */ - uc-g-with-spur: 10; /* Capital G with spur */ - single-story-a: 11; /* Single-story a */ - compact-lc-f: 12; /* Compact f */ - compact-lc-t: 13; /* Compact t */ - } - @styleset { - ss01: 1; - ss02: 2; - ss03: 3; - ss04: 4; - ss05: 5; - ss06: 6; - ss07: 7; - ss08: 8; - open-digits: 1; /* Open digits */ - disambiguation: 2; /* Disambiguation (with zero) */ - disambiguation-except-zero: 4; /* Disambiguation (no zero) */ - round-quotes-and-commas: 3; /* Round quotes & commas */ - square-punctuation: 7; /* Square punctuation */ - square-quotes: 8; /* Square quotes */ - circled-characters: 5; /* Circled characters */ - squared-characters: 6; /* Squared characters */ - } -} -@font-feature-values Inter { - - @character-variant { - cv01: 1; - cv02: 2; - cv03: 3; - cv04: 4; - cv05: 5; - cv06: 6; - cv07: 7; - cv08: 8; - cv09: 9; - cv10: 10; - cv11: 11; - cv12: 12; - cv13: 13; - alt-1: 1; /* Alternate one */ - alt-3: 9; /* Flat-top three */ - open-4: 2; /* Open four */ - open-6: 3; /* Open six */ - open-9: 4; /* Open nine */ - lc-l-with-tail: 5; /* Lower-case L with tail */ - simplified-u: 6; /* Simplified u */ - alt-double-s: 7; /* Alternate German double s */ - uc-i-with-serif: 8; /* Upper-case i with serif */ - uc-g-with-spur: 10; /* Capital G with spur */ - single-story-a: 11; /* Single-story a */ - compact-lc-f: 12; /* Compact f */ - compact-lc-t: 13; /* Compact t */ - } - @styleset { - ss01: 1; - ss02: 2; - ss03: 3; - ss04: 4; - ss05: 5; - ss06: 6; - ss07: 7; - ss08: 8; - open-digits: 1; /* Open digits */ - disambiguation: 2; /* Disambiguation (with zero) */ - disambiguation-except-zero: 4; /* Disambiguation (no zero) */ - round-quotes-and-commas: 3; /* Round quotes & commas */ - square-punctuation: 7; /* Square punctuation */ - square-quotes: 8; /* Square quotes */ - circled-characters: 5; /* Circled characters */ - squared-characters: 6; /* Squared characters */ - } -} -@font-feature-values InterDisplay { - @character-variant { - cv01: 1; - cv02: 2; - cv03: 3; - cv04: 4; - cv05: 5; - cv06: 6; - cv07: 7; - cv08: 8; - cv09: 9; - cv10: 10; - cv11: 11; - cv12: 12; - cv13: 13; - alt-1: 1; /* Alternate one */ - alt-3: 9; /* Flat-top three */ - open-4: 2; /* Open four */ - open-6: 3; /* Open six */ - open-9: 4; /* Open nine */ - lc-l-with-tail: 5; /* Lower-case L with tail */ - simplified-u: 6; /* Simplified u */ - alt-double-s: 7; /* Alternate German double s */ - uc-i-with-serif: 8; /* Upper-case i with serif */ - uc-g-with-spur: 10; /* Capital G with spur */ - single-story-a: 11; /* Single-story a */ - compact-lc-f: 12; /* Compact f */ - compact-lc-t: 13; /* Compact t */ - } - @styleset { - ss01: 1; - ss02: 2; - ss03: 3; - ss04: 4; - ss05: 5; - ss06: 6; - ss07: 7; - ss08: 8; - open-digits: 1; /* Open digits */ - disambiguation: 2; /* Disambiguation (with zero) */ - disambiguation-except-zero: 4; /* Disambiguation (no zero) */ - round-quotes-and-commas: 3; /* Round quotes & commas */ - square-punctuation: 7; /* Square punctuation */ - square-quotes: 8; /* Square quotes */ - circled-characters: 5; /* Circled characters */ - squared-characters: 6; /* Squared characters */ - } -} diff --git a/packages/next/app/fonts/MiSans/MiSans.css b/packages/next/app/fonts/MiSans/MiSans.css deleted file mode 100644 index 9c80a29..0000000 --- a/packages/next/app/fonts/MiSans/MiSans.css +++ /dev/null @@ -1,88 +0,0 @@ -@font-face { - font-family: "MiSans VF"; - font-style: normal; - font-weight: 150 700; - font-display: swap; - src: url("MiSans VF.woff2") format("woff2"); -} - - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 100; - font-display: swap; - src: url("MiSans-Thin.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 200; - font-display: swap; - src: url("MiSans-ExtraLight.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 300; - font-display: swap; - src: url("MiSans-Light.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 360; - font-display: swap; - src: url("MiSans-Normal.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url("MiSans-Regular.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 500; - font-display: swap; - src: url("MiSans-Medium.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 600; - font-display: swap; - src: url("MiSans-Demibold.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url("MiSans-Semibold.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 800; - font-display: swap; - src: url("MiSans-Bold.woff2") format("woff2"); -} - -@font-face { - font-family: "MiSans"; - font-style: normal; - font-weight: 900; - font-display: swap; - src: url("MiSans-Heavy.woff2") format("woff2"); -} \ No newline at end of file diff --git a/packages/next/bun.lock b/packages/next/bun.lock index b680736..26d5265 100644 --- a/packages/next/bun.lock +++ b/packages/next/bun.lock @@ -5,7 +5,9 @@ "name": "next", "dependencies": { "framer-motion": "^12.12.2", + "i18next": "^25.2.1", "next": "^15.1.8", + "next-intl": "^4.1.0", "react": "^19.1.0", "react-dom": "^19.1.0", "swr": "^2.3.3", @@ -26,8 +28,20 @@ "@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="], + "@babel/runtime": ["@babel/runtime@7.27.4", "", {}, "sha512-t3yaEOuGu9NlIZ+hIeGbBjFtZT7j2cb2tg0fuaJKeGotchRjjLfrBA9Kwf8quhpP1EUuxModQg04q/mBwyg8uA=="], + "@emnapi/runtime": ["@emnapi/runtime@1.4.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ=="], + "@formatjs/ecma402-abstract": ["@formatjs/ecma402-abstract@2.3.4", "", { "dependencies": { "@formatjs/fast-memoize": "2.2.7", "@formatjs/intl-localematcher": "0.6.1", "decimal.js": "^10.4.3", "tslib": "^2.8.0" } }, "sha512-qrycXDeaORzIqNhBOx0btnhpD1c+/qFIHAN9znofuMJX6QBwtbrmlpWfD4oiUUD2vJUOIYFA/gYtg2KAMGG7sA=="], + + "@formatjs/fast-memoize": ["@formatjs/fast-memoize@2.2.7", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-Yabmi9nSvyOMrlSeGGWDiH7rf3a7sIwplbvo/dlz9WCIjzIQAfy1RMf4S0X3yG724n5Ghu2GmEl5NJIV6O9sZQ=="], + + "@formatjs/icu-messageformat-parser": ["@formatjs/icu-messageformat-parser@2.11.2", "", { "dependencies": { "@formatjs/ecma402-abstract": "2.3.4", "@formatjs/icu-skeleton-parser": "1.8.14", "tslib": "^2.8.0" } }, "sha512-AfiMi5NOSo2TQImsYAg8UYddsNJ/vUEv/HaNqiFjnI3ZFfWihUtD5QtuX6kHl8+H+d3qvnE/3HZrfzgdWpsLNA=="], + + "@formatjs/icu-skeleton-parser": ["@formatjs/icu-skeleton-parser@1.8.14", "", { "dependencies": { "@formatjs/ecma402-abstract": "2.3.4", "tslib": "^2.8.0" } }, "sha512-i4q4V4qslThK4Ig8SxyD76cp3+QJ3sAqr7f6q9VVfeGtxG9OhiAk3y9XF6Q41OymsKzsGQ6OQQoJNY4/lI8TcQ=="], + + "@formatjs/intl-localematcher": ["@formatjs/intl-localematcher@0.5.10", "", { "dependencies": { "tslib": "2" } }, "sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q=="], + "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.34.2", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.1.0" }, "os": "darwin", "cpu": "arm64" }, "sha512-OfXHZPppddivUJnqyKoi5YVeHRkkNE2zUFT2gbpKxp/JZCFYEYubnMg+gOp6lWfasPrTS+KPosKqdI+ELYVDtg=="], "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.34.2", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.1.0" }, "os": "darwin", "cpu": "x64" }, "sha512-dYvWqmjU9VxqXmjEtjmvHnGqF8GrVjM2Epj9rJ6BUIXvk8slvNDJbhGFvIoXzkDhrJC2jUxNLz/GUjjvSzfw+g=="], @@ -100,6 +114,8 @@ "@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@15.3.2", "", { "os": "win32", "cpu": "x64" }, "sha512-aW5B8wOPioJ4mBdMDXkt5f3j8pUr9W8AnlX0Df35uRWNT1Y6RIybxjnSUe+PhM+M1bwgyY8PHLmXZC6zT1o5tA=="], + "@schummar/icu-type-parser": ["@schummar/icu-type-parser@1.21.5", "", {}, "sha512-bXHSaW5jRTmke9Vd0h5P7BtWZG9Znqb8gSDxZnxaGSJnGwPLDPfS+3g0BKzeWqzgZPsIVZkM7m2tbo18cm5HBw=="], + "@swc/counter": ["@swc/counter@0.1.3", "", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="], "@swc/helpers": ["@swc/helpers@0.5.15", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g=="], @@ -158,6 +174,8 @@ "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + "decimal.js": ["decimal.js@10.5.0", "", {}, "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw=="], + "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], "detect-libc": ["detect-libc@2.0.4", "", {}, "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA=="], @@ -168,6 +186,10 @@ "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + "i18next": ["i18next@25.2.1", "", { "dependencies": { "@babel/runtime": "^7.27.1" }, "peerDependencies": { "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-+UoXK5wh+VlE1Zy5p6MjcvctHXAhRwQKCxiJD8noKZzIXmnAX8gdHX5fLPA3MEVxEN4vbZkQFy8N0LyD9tUqPw=="], + + "intl-messageformat": ["intl-messageformat@10.7.16", "", { "dependencies": { "@formatjs/ecma402-abstract": "2.3.4", "@formatjs/fast-memoize": "2.2.7", "@formatjs/icu-messageformat-parser": "2.11.2", "tslib": "^2.8.0" } }, "sha512-UmdmHUmp5CIKKjSoE10la5yfU+AYJAaiYLsodbjL4lji83JNvgOQUjGaGhGrpFCb0Uh7sl7qfP1IyILa8Z40ug=="], + "is-arrayish": ["is-arrayish@0.3.2", "", {}, "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="], "jiti": ["jiti@2.4.2", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A=="], @@ -208,8 +230,12 @@ "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], + "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], + "next": ["next@15.3.2", "", { "dependencies": { "@next/env": "15.3.2", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.15", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "15.3.2", "@next/swc-darwin-x64": "15.3.2", "@next/swc-linux-arm64-gnu": "15.3.2", "@next/swc-linux-arm64-musl": "15.3.2", "@next/swc-linux-x64-gnu": "15.3.2", "@next/swc-linux-x64-musl": "15.3.2", "@next/swc-win32-arm64-msvc": "15.3.2", "@next/swc-win32-x64-msvc": "15.3.2", "sharp": "^0.34.1" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-CA3BatMyHkxZ48sgOCLdVHjFU36N7TF1HhqAHLFOkV6buwZnvMI84Cug8xD56B9mCuKrqXnLn94417GrZ/jjCQ=="], + "next-intl": ["next-intl@4.1.0", "", { "dependencies": { "@formatjs/intl-localematcher": "^0.5.4", "negotiator": "^1.0.0", "use-intl": "^4.1.0" }, "peerDependencies": { "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0", "typescript": "^5.0.0" }, "optionalPeers": ["typescript"] }, "sha512-JNJRjc7sdnfUxhZmGcvzDszZ60tQKrygV/VLsgzXhnJDxQPn1cN2rVpc53adA1SvBJwPK2O6Sc6b4gYSILjCzw=="], + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], "postcss": ["postcss@8.5.3", "", { "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A=="], @@ -254,12 +280,16 @@ "undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="], + "use-intl": ["use-intl@4.1.0", "", { "dependencies": { "@formatjs/fast-memoize": "^2.2.0", "@schummar/icu-type-parser": "1.21.5", "intl-messageformat": "^10.5.14" }, "peerDependencies": { "react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0" } }, "sha512-mQvDYFvoGn+bm/PWvlQOtluKCknsQ5a9F1Cj0hMfBjMBVTwnOqLPd6srhjvVdEQEQFVyHM1PfyifKqKYb11M9Q=="], + "use-sync-external-store": ["use-sync-external-store@1.5.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A=="], "yallist": ["yallist@5.0.0", "", {}, "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="], "yup": ["yup@1.6.1", "", { "dependencies": { "property-expr": "^2.0.5", "tiny-case": "^1.0.3", "toposort": "^2.0.2", "type-fest": "^2.19.0" } }, "sha512-JED8pB50qbA4FOkDol0bYF/p60qSEDQqBD0/qeIrUCG1KbPBIQ776fCUNb9ldbPcSTxA69g/47XTo4TqWiuXOA=="], + "@formatjs/ecma402-abstract/@formatjs/intl-localematcher": ["@formatjs/intl-localematcher@0.6.1", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-ePEgLgVCqi2BBFnTMWPfIghu6FkbZnnBVhO2sSxvLfrdFw7wCHAHiDoM2h4NRgjbaY7+B7HgOLZGkK187pZTZg=="], + "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.4.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ=="], diff --git a/packages/next/components/ui/Dialog.tsx b/packages/next/components/ui/Dialog.tsx index 49ddf59..5bc3904 100644 --- a/packages/next/components/ui/Dialog.tsx +++ b/packages/next/components/ui/Dialog.tsx @@ -13,11 +13,6 @@ export const useDisableBodyScroll = (open: boolean) => { }, [open]); }; -interface DialogProps { - show: boolean; - children?: React.ReactNode; -} - type OptionalChidrenProps> = T & { children?: React.ReactNode; }; @@ -33,6 +28,10 @@ type DialogButtonGroupProps = OptionalChidrenProps; interface DialogButtonProps extends OptionalChidrenProps { onClick?: React.MouseEventHandler; } +interface DialogProps extends OptionalChidrenProps { + show: boolean; + children?: React.ReactNode; +} export const DialogHeadline: React.FC = ({ children, @@ -52,7 +51,13 @@ export const DialogSupportingText: React.FC = ({ ...rest }: DialogHeadlineProps) => { return ( -

    +
    {children}
    ); @@ -74,7 +79,7 @@ export const DialogButtonGroup: React.FC = ({ children, ); }; -export const Dialog: React.FC = ({ show, children }: DialogProps) => { +export const Dialog: React.FC = ({ show, children, className }: DialogProps) => { useDisableBodyScroll(show); return ( @@ -89,8 +94,8 @@ export const Dialog: React.FC = ({ show, children }: DialogProps) = transition={{ duration: 0.3 }} /> { + // Typically corresponds to the `[locale]` segment + const requested = await requestLocale; + const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale; + + return { + locale, + messages: stringsMap[locale] + }; +}); diff --git a/packages/next/i18n/routing.ts b/packages/next/i18n/routing.ts new file mode 100644 index 0000000..c9db02e --- /dev/null +++ b/packages/next/i18n/routing.ts @@ -0,0 +1,9 @@ +import { defineRouting } from "next-intl/routing"; + +export const routing = defineRouting({ + // A list of all locales that are supported + locales: ["en", "zh"], + + // Used when no locale matches + defaultLocale: "zh" +}); diff --git a/packages/next/i18n/strings/en.json b/packages/next/i18n/strings/en.json new file mode 100644 index 0000000..8c4b516 --- /dev/null +++ b/packages/next/i18n/strings/en.json @@ -0,0 +1,6 @@ +{ + "yup_errors": { + "field_too_short": "{field}至少需要{min}个字符。", + "field_too_long": "{field}不能多于{max}个字符。" + } +} diff --git a/packages/next/i18n/strings/zh.json b/packages/next/i18n/strings/zh.json new file mode 100644 index 0000000..9b915b2 --- /dev/null +++ b/packages/next/i18n/strings/zh.json @@ -0,0 +1,10 @@ +{ + "yup_errors": { + "field_too_short": "{field}至少需要 {min} 个字符。", + "field_too_big": "{field}不能多于 {max} 个字符。", + "field_required": "请填写{field}。" + }, + "username": "用户名", + "password": "密码", + "nickname": "昵称" +} diff --git a/packages/next/lib/middleware.ts b/packages/next/lib/middleware.ts new file mode 100644 index 0000000..2396cbc --- /dev/null +++ b/packages/next/lib/middleware.ts @@ -0,0 +1,11 @@ +import createMiddleware from "next-intl/middleware"; +import { routing } from "@/i18n/routing"; + +export default createMiddleware(routing); + +export const config = { + // Match all pathnames except for + // - … if they start with `/api`, `/trpc`, `/_next` or `/_vercel` + // - … the ones containing a dot (e.g. `favicon.ico`) + matcher: "/((?!api|trpc|_next|_vercel|.*\\..*).*)" +}; diff --git a/packages/next/next.config.ts b/packages/next/next.config.ts index b8feafd..18b7ec9 100644 --- a/packages/next/next.config.ts +++ b/packages/next/next.config.ts @@ -1,7 +1,10 @@ import type { NextConfig } from "next"; +import createNextIntlPlugin from "next-intl/plugin"; const nextConfig: NextConfig = { devIndicators: false }; -export default nextConfig; +const withNextIntl = createNextIntlPlugin(); + +export default withNextIntl(nextConfig); diff --git a/packages/next/package.json b/packages/next/package.json index 69269d6..e97702c 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -11,7 +11,9 @@ }, "dependencies": { "framer-motion": "^12.12.2", + "i18next": "^25.2.1", "next": "^15.1.8", + "next-intl": "^4.1.0", "react": "^19.1.0", "react-dom": "^19.1.0", "swr": "^2.3.3",