Detect locale with is-china-user and show English copy for non-Chinese visitors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric
2026-08-03 08:54:39 -05:00
parent 4c2101a87a
commit af0a430864
9 changed files with 233 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ import "./globals.css";
import { type Metadata, type Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { LocaleProvider } from "~/components/locale-provider";
export const viewport: Viewport = {
width: "device-width",
@@ -52,7 +53,7 @@ export default function RootLayout({
return (
<html lang="zh-CN" className={`${geist.variable} ${geistMono.variable}`}>
<body className="font-sans antialiased">
{children}
<LocaleProvider>{children}</LocaleProvider>
</body>
</html>
);