From 99ad3f6f8e8619a4096fcbaefc492038c2d4adf3 Mon Sep 17 00:00:00 2001 From: oiov Date: Thu, 5 Jun 2025 15:25:58 +0800 Subject: [PATCH 01/12] chore --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 972708f..fd5148d 100644 --- a/.env.example +++ b/.env.example @@ -42,7 +42,7 @@ SCREENSHOTONE_BASE_URL=https://shot.wr.do # GitHub api token for getting gitHub stars count GITHUB_TOKEN= -# Skip DB check and migration (only for docker). if false, will check and migrate database each time start docker compose. +# Skip DB check and migration. if false, will check and migrate database each time start docker compose. SKIP_DB_CHECK=false SKIP_DB_MIGRATION=false From ab8e0619c4223596804bb9f84b758b50cd02b85f Mon Sep 17 00:00:00 2001 From: oiov Date: Thu, 5 Jun 2025 16:25:15 +0800 Subject: [PATCH 02/12] feats: init i18n config --- .github/workflows/docker-build-push.yml | 1 + app/(marketing)/page.tsx | 6 +- app/layout.tsx | 34 +- components/sections/hero-landing.tsx | 14 +- i18n/request.ts | 45 + locales/en.json | 6 + locales/zh.json | 6 + next.config.js => next.config.mjs | 11 +- package.json | 6 +- pnpm-lock.yaml | 286 ++- public/sitemap-0.xml | 47 +- public/sw.js | 102 +- public/sw.js.map | 1 - public/workbox-8817a5e5.js | 2456 ----------------------- public/workbox-8817a5e5.js.map | 1 - public/workbox-e9849328.js | 1 + tsconfig.json | 3 +- 17 files changed, 371 insertions(+), 2655 deletions(-) create mode 100644 i18n/request.ts create mode 100644 locales/en.json create mode 100644 locales/zh.json rename next.config.js => next.config.mjs (86%) delete mode 100644 public/sw.js.map delete mode 100644 public/workbox-8817a5e5.js delete mode 100644 public/workbox-8817a5e5.js.map create mode 100644 public/workbox-e9849328.js diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 683369d..0f3147d 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -5,6 +5,7 @@ on: branches: - main - fix/docker + - i18n tags: - "v*.*.*" pull_request: diff --git a/app/(marketing)/page.tsx b/app/(marketing)/page.tsx index 441bb37..1356a4c 100644 --- a/app/(marketing)/page.tsx +++ b/app/(marketing)/page.tsx @@ -1,10 +1,12 @@ +import { getCurrentUser } from "@/lib/session"; import HeroLanding, { LandingImages } from "@/components/sections/hero-landing"; import { PricingSection } from "@/components/sections/pricing"; -export default function IndexPage() { +export default async function IndexPage() { + const user = await getCurrentUser(); return ( <> - + diff --git a/app/layout.tsx b/app/layout.tsx index 4b023c0..2411e06 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,6 +2,8 @@ import "@/styles/globals.css"; import { fontHeading, fontSans, fontSatoshi } from "@/assets/fonts"; import { SessionProvider } from "next-auth/react"; +import { NextIntlClientProvider } from "next-intl"; +import { getLocale, getMessages } from "next-intl/server"; import { ThemeProvider } from "next-themes"; import { ViewTransitions } from "next-view-transitions"; @@ -18,10 +20,12 @@ interface RootLayoutProps { export const metadata = constructMetadata(); -export default function RootLayout({ children }: RootLayoutProps) { +export default async function RootLayout({ children }: RootLayoutProps) { + const locale = await getLocale(); + const messages = await getMessages(); return ( - +