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

@@ -1,6 +1,11 @@
"use client";
import Link from "next/link";
import { useLocale } from "~/components/locale-provider";
export default function AboutPage() {
const { t } = useLocale();
return (
<div
className="flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
@@ -10,16 +15,15 @@ export default function AboutPage() {
}}
>
<div className="mx-auto w-full max-w-md">
<h1 className="text-xl font-bold text-neutral-900">关于 Nomadro</h1>
<h1 className="text-xl font-bold text-neutral-900">{t.about.title}</h1>
<p className="mt-4 text-sm leading-relaxed text-neutral-600">
Nomadro 是中文数字游民操作系统,提供游民导航、地理套利、直播工具箱等模块,
帮助更多人从固定工位走向自由生活与自由收入。
{t.about.body}
</p>
<Link
href="/"
className="mt-8 inline-block text-sm text-violet-600 active:text-violet-800"
>
← 返回首页
{t.about.backHome}
</Link>
</div>
</div>

View File

@@ -1,6 +1,11 @@
"use client";
import Link from "next/link";
import { useLocale } from "~/components/locale-provider";
export default function ContactPage() {
const { t } = useLocale();
return (
<div
className="flex min-h-dvh flex-col bg-[#f8f7fc] px-5 py-10"
@@ -10,9 +15,9 @@ export default function ContactPage() {
}}
>
<div className="mx-auto w-full max-w-md">
<h1 className="text-xl font-bold text-neutral-900">联系我们</h1>
<h1 className="text-xl font-bold text-neutral-900">{t.contact.title}</h1>
<p className="mt-4 text-sm leading-relaxed text-neutral-600">
加入数字游民社群,获取最新动态与交流机会。
{t.contact.body}
</p>
<div className="mt-6 flex flex-col gap-3">
<Link
@@ -21,7 +26,7 @@ export default function ContactPage() {
rel="noopener noreferrer"
className="flex h-12 items-center justify-center rounded-2xl bg-violet-600 text-sm font-medium text-white active:bg-violet-700"
>
🎬 直播工具箱
{t.contact.liveCta}
</Link>
<Link
href="https://vip.hackrobot.cn"
@@ -29,14 +34,14 @@ export default function ContactPage() {
rel="noopener noreferrer"
className="flex h-12 items-center justify-center rounded-2xl border border-neutral-200 bg-white text-sm font-medium text-neutral-700 active:bg-neutral-50"
>
👑 会员社群
{t.contact.vipCta}
</Link>
</div>
<Link
href="/"
className="mt-8 inline-block text-sm text-violet-600 active:text-violet-800"
>
← 返回首页
{t.contact.backHome}
</Link>
</div>
</div>

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>
);

View File

@@ -1,6 +1,12 @@
"use client";
import { Hero } from "~/components/sections/hero";
import { useLocale } from "~/components/locale-provider";
export default function HomePage() {
const { t } = useLocale();
const year = new Date().getFullYear();
return (
<div
className="flex min-h-dvh flex-col"
@@ -13,7 +19,7 @@ export default function HomePage() {
className="shrink-0 py-5 text-center text-[11px] text-neutral-400"
style={{ paddingBottom: "max(1.25rem, var(--safe-bottom))" }}
>
© {new Date().getFullYear()} Nomadro
{t.copyright.replace("{year}", String(year))}
</footer>
</div>
);