feat(i18n) : add personal languages and compact weapon exports
CI / Verify (push) Successful in 1m18s
CI / Build immutable images and deploy (push) Successful in 1m57s

This commit is contained in:
2026-09-14 16:44:44 +07:00 Unverified
parent f214d330f0
commit e0794822b1
72 changed files with 4199 additions and 1011 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import { Localized } from "@/components/i18n/text";
import Link from "next/link";
import Image from "next/image";
import { ArrowLeftIcon } from "lucide-react";
@@ -65,7 +66,7 @@ export default async function StructuredEditorPage({
<AdminHeader />
<main className="mx-auto flex w-full max-w-6xl flex-col gap-6 p-4 sm:p-6 lg:p-8">
<header className="flex items-center gap-4">
<Button
<Localized attributes={{ "aria-label": "กลับ Dashboard" }}><Button
variant="outline"
size="icon"
render={<Link href="/admin" />}
@@ -73,7 +74,7 @@ export default async function StructuredEditorPage({
aria-label="กลับ Dashboard"
>
<ArrowLeftIcon />
</Button>
</Button></Localized>
<div className="relative size-16 shrink-0 overflow-hidden rounded-lg border">
<Image src={guide.coverUrl} alt={guide.name} fill sizes="64px" className="object-cover" />
</div>
+4 -3
View File
@@ -1,3 +1,4 @@
import { Localized, Text } from "@/components/i18n/text";
import Image from "next/image";
import Link from "next/link";
import { ArrowLeftIcon, ArrowUpRightIcon } from "lucide-react";
@@ -40,14 +41,14 @@ export default async function GuideOverviewPage({ params }: { params: Promise<{
<AdminHeader />
<main className="mx-auto flex w-full max-w-6xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header className="flex flex-wrap items-center gap-4">
<Button variant="outline" size="icon" render={<Link href="/admin" />} nativeButton={false} aria-label="กลับ Dashboard">
<Localized attributes={{ "aria-label": "กลับ Dashboard" }}><Button variant="outline" size="icon" render={<Link href="/admin" />} nativeButton={false} aria-label="กลับ Dashboard">
<ArrowLeftIcon />
</Button>
</Button></Localized>
<div className="relative size-16 overflow-hidden rounded-lg border">
<Image src={guide.coverUrl} alt={guide.name} fill sizes="64px" className="object-cover" />
</div>
<div className="min-w-0 flex-1">
<p className="text-sm text-muted-foreground">เลือกส่วนที่ต้องการแก้ไข</p>
<p className="text-sm text-muted-foreground"><Text message="เลือกส่วนที่ต้องการแก้ไข" /></p>
<h1 className="font-heading text-3xl font-semibold">{guide.name}</h1>
<EditorPresence guideId={guide.id} section="Overview" />
</div>
+3 -2
View File
@@ -1,3 +1,4 @@
import { Localized, Text } from "@/components/i18n/text";
import Link from "next/link";
import { ArrowLeftIcon } from "lucide-react";
import { redirect } from "next/navigation";
@@ -19,8 +20,8 @@ export default async function CreateGuidePage() {
<AdminHeader />
<main className="mx-auto flex w-full max-w-7xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header className="flex items-center gap-4">
<Button variant="outline" size="icon" render={<Link href="/admin" />} nativeButton={false} aria-label="กลับ Dashboard"><ArrowLeftIcon /></Button>
<div><p className="text-sm text-muted-foreground">Catalog ล่าสุดจาก Lunaris</p><h1 className="font-heading text-3xl font-semibold">สร้าง Guide ใหม่</h1></div>
<Localized attributes={{ "aria-label": "กลับ Dashboard" }}><Button variant="outline" size="icon" render={<Link href="/admin" />} nativeButton={false} aria-label="กลับ Dashboard"><ArrowLeftIcon /></Button></Localized>
<div><p className="text-sm text-muted-foreground"><Text message="Catalog ล่าสุดจาก Lunaris" /></p><h1 className="font-heading text-3xl font-semibold"><Text message="สร้าง Guide ใหม่" /></h1></div>
</header>
<CreateGuideFlow characters={catalog.characters} existingKeys={guides.map((guide) => guide.characterKey)} />
</main>
+4 -5
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import { redirect } from "next/navigation";
import { connection } from "next/server";
@@ -29,13 +30,11 @@ export default async function OverviewImagePage() {
<AdminHeader />
<main className="mx-auto flex w-full max-w-7xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header>
<p className="text-sm font-medium text-primary">Image generator</p>
<p className="text-sm font-medium text-primary"><Text message="Image generator" /></p>
<h1 className="font-heading text-3xl font-semibold">
สร้างภาพ Overview
</h1>
<Text message="สร้างภาพ Overview" /></h1>
<p className="mt-2 text-muted-foreground">
สร้างและดาวน์โหลดภาพ PNG ขนาด 3000×3000 โดยไม่เปลี่ยนภาพใน Guide
</p>
<Text message="สร้างและดาวน์โหลดภาพ PNG ขนาด 3000×3000 โดยไม่เปลี่ยนภาพใน Guide" /></p>
</header>
<OverviewImageGenerator
characters={catalog.characters.map((character) => ({
+3 -2
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import { redirect } from "next/navigation";
import { connection } from "next/server";
@@ -20,8 +21,8 @@ export default async function GlossaryPage() {
<AdminHeader />
<main className="mx-auto flex w-full max-w-4xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header>
<p className="text-sm font-medium text-primary">Search shortcuts</p>
<h1 className="font-heading text-3xl font-semibold">Glossary Manager</h1>
<p className="text-sm font-medium text-primary"><Text message="Search shortcuts" /></p>
<h1 className="font-heading text-3xl font-semibold"><Text message="Glossary Manager" /></h1>
</header>
<GlossaryManager aliases={aliases} catalogs={{
character: catalog.characters,
+4 -3
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import { redirect } from "next/navigation";
import { connection } from "next/server";
@@ -22,9 +23,9 @@ export default async function AdminPage() {
<AdminHeader />
<main className="mx-auto flex w-full max-w-7xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header>
<p className="text-sm font-medium text-primary">Content workspace</p>
<h1 className="font-heading text-3xl font-semibold">Guide Dashboard</h1>
<p className="mt-2 text-muted-foreground">จัดการ Guide แบบภาพ-first และบันทึกขึ้นเว็บไซต์ทันที</p>
<p className="text-sm font-medium text-primary"><Text message="Content workspace" /></p>
<h1 className="font-heading text-3xl font-semibold"><Text message="Guide Dashboard" /></h1>
<p className="mt-2 text-muted-foreground"><Text message="จัดการ Guide แบบภาพ-first และบันทึกขึ้นเว็บไซต์ทันที" /></p>
</header>
<StructuredDashboard guides={guides} trash={trash} catalogVersion={catalogVersion} />
</main>
+4 -4
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import { asc } from "drizzle-orm";
import { redirect } from "next/navigation";
import { connection } from "next/server";
@@ -28,11 +29,10 @@ export default async function RegisterPage() {
<AdminHeader />
<main className="mx-auto flex w-full max-w-7xl flex-col gap-6 p-4 sm:p-6 lg:p-8">
<header>
<p className="text-sm font-medium text-primary">Admin access</p>
<h1 className="font-heading text-3xl font-semibold">จัดการบัญชี</h1>
<p className="text-sm font-medium text-primary"><Text message="Admin access" /></p>
<h1 className="font-heading text-3xl font-semibold"><Text message="จัดการบัญชี" /></h1>
<p className="mt-2 text-muted-foreground">
สร้างบัญชีให้ผู้ดูแลคนอื่น หรือลบบัญชีที่ไม่ต้องใช้งานแล้ว
</p>
<Text message="สร้างบัญชีให้ผู้ดูแลคนอื่น หรือลบบัญชีที่ไม่ต้องใช้งานแล้ว" /></p>
</header>
<RegisterCard accounts={accounts} currentUserId={session.user.id} />
</main>
+3
View File
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Anuphan, Geist_Mono } from "next/font/google";
import { LocaleProvider } from "@/components/i18n/locale-provider";
import { DeploymentUpdateNotifier } from "@/components/deployment-update-notifier";
import { PageProgress } from "@/components/page-progress";
import { Toaster } from "@/components/ui/sonner";
@@ -38,6 +39,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
className={`dark ${anuphan.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="flex min-h-full flex-col">
<LocaleProvider>
<PageProgress />
{children}
<DeploymentUpdateNotifier deploymentId={deploymentId} />
@@ -47,6 +49,7 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
position="bottom-right"
toastOptions={{ className: anuphan.className }}
/>
</LocaleProvider>
</body>
</html>
);
+4 -4
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import Link from "next/link";
import { MapPinOffIcon } from "lucide-react";
@@ -20,13 +21,12 @@ export default function NotFound() {
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon"><MapPinOffIcon aria-hidden="true" /></EmptyMedia>
<EmptyTitle>ไม่พบคู่มือนี้</EmptyTitle>
<EmptyTitle><Text message="ไม่พบคู่มือนี้" /></EmptyTitle>
<EmptyDescription>
หน้านี้อาจถูกซ่อน เปลี่ยนชื่อ หรือยังไม่มีเนื้อหาที่เผยแพร่
</EmptyDescription>
<Text message="หน้านี้อาจถูกซ่อน เปลี่ยนชื่อ หรือยังไม่มีเนื้อหาที่เผยแพร่" /></EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button render={<Link href="/" />}>กลับไปหน้ารวมตัวละคร</Button>
<Button render={<Link href="/" />}><Text message="กลับไปหน้ารวมตัวละคร" /></Button>
</EmptyContent>
</Empty>
</main>
+3 -4
View File
@@ -1,3 +1,4 @@
import { Text } from "@/components/i18n/text";
import { connection } from "next/server";
import { Suspense } from "react";
@@ -21,11 +22,9 @@ export default function HomePage() {
<main className="mx-auto flex w-full max-w-7xl flex-col gap-8 px-4 py-10 sm:px-6 sm:py-14">
<header className="max-w-3xl">
<h1 className="mt-2 font-heading text-4xl font-semibold">
เลือกตัวละครแล้วส่องดูได้เลย
</h1>
<Text message="เลือกตัวละครแล้วส่องดูได้เลย" /></h1>
<p className="mt-3 text-lg leading-8 text-muted-foreground">
ไกด์ตัวละคร อาวุธ อาร์ติแฟกต์ กลุ่มดาว และคำนวณทีม
</p>
<Text message="ไกด์ตัวละคร อาวุธ อาร์ติแฟกต์ กลุ่มดาว และคำนวณทีม" /></p>
</header>
<Suspense fallback={<div className="min-h-svh" aria-hidden="true" />}>
<DirectoryContent />
+16 -23
View File
@@ -1,3 +1,4 @@
import { Text, Localized } from "@/components/i18n/text";
import type { Metadata } from "next";
import Image from "next/image";
import Link from "next/link";
@@ -79,7 +80,7 @@ export default function ThanksPage() {
height={36}
className="size-9 object-contain"
/>
<span>ไกด์เกนชินไม่ใช่เกมมือถือ</span>
<span><Text message="ไกด์เกนชินไม่ใช่เกมมือถือ" /></span>
</Link>
</div>
</header>
@@ -87,11 +88,9 @@ export default function ThanksPage() {
<main className="mx-auto flex w-full max-w-6xl flex-col gap-10 px-4 py-12 sm:px-6 sm:py-16">
<header className="mx-auto flex max-w-2xl flex-col gap-3 text-center">
<h1 className="font-heading text-4xl font-semibold tracking-tight sm:text-5xl">
Special Thanks
</h1>
<Text message="Special Thanks" /></h1>
<p className="text-lg leading-8 text-muted-foreground">
ขอบคุณทุกคนที่มอบแรงสนับสนุนและเวลาให้เว็บไซต์นี้เกิดขึ้นได้
</p>
<Text message="ขอบคุณทุกคนที่มอบแรงสนับสนุนและเวลาให้เว็บไซต์นี้เกิดขึ้นได้" /></p>
</header>
<Card className="w-full gap-0 py-0 sm:flex-row sm:items-center">
@@ -105,16 +104,13 @@ export default function ThanksPage() {
className="row-span-2 size-16 object-contain"
/>
<CardTitle className="text-xl sm:text-2xl">
Astral Development
</CardTitle>
<Text message="Astral Development" /></CardTitle>
<CardDescription className="font-medium">
ผู้สนับสนุนหลักด้าน Development
</CardDescription>
<Text message="ผู้สนับสนุนหลักด้าน Development" /></CardDescription>
</CardHeader>
<CardContent className="pb-4 sm:max-w-md sm:py-4">
<p className="leading-6 text-muted-foreground">
ขอบคุณที่สนับสนุนระบบ Hosting ที่สามารถให้เว็บออนไลน์และพร้อมใช้งาน
</p>
<Text message="ขอบคุณที่สนับสนุนระบบ Hosting ที่สามารถให้เว็บออนไลน์และพร้อมใช้งาน" /></p>
</CardContent>
<CardFooter className="justify-center sm:self-stretch sm:border-t-0 sm:border-l">
<Button
@@ -123,14 +119,13 @@ export default function ThanksPage() {
<Link href="https://astrxl.dev" target="_blank" rel="noreferrer" />
}
>
เยี่ยมชม Astral
<ExternalLinkIcon data-icon="inline-end" />
<Text message="เยี่ยมชม Astral" /><ExternalLinkIcon data-icon="inline-end" />
</Button>
</CardFooter>
</Card>
{specialThanks.length > 0 ? (
<section
<Localized attributes={{ "aria-label": "รายชื่อผู้สนับสนุน" }}><section
aria-label="รายชื่อผู้สนับสนุน"
className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"
>
@@ -138,21 +133,20 @@ export default function ThanksPage() {
<Card key={person.username}>
<CardHeader className="justify-items-center text-center">
<Avatar className="size-20">
<AvatarImage
<Localized attributes={{ "alt": { message: "รูปโปรไฟล์ของ {name}", params: { name: person.username } } }}><AvatarImage
src={`/thanks/${person.profile}`}
alt={`รูปโปรไฟล์ของ ${person.username}`}
/>
/></Localized>
<AvatarFallback>{getInitials(person.username)}</AvatarFallback>
</Avatar>
<CardTitle className="mt-2">{person.username}</CardTitle>
{person.role ? (
<CardDescription>{person.role}</CardDescription>
<CardDescription><Text message={person.role} /></CardDescription>
) : null}
</CardHeader>
<CardContent>
<p className="text-center text-muted-foreground">
ขอบคุณที่เป็นส่วนสำคัญของเว็บไซด์นี้
</p>
<Text message="ขอบคุณที่เป็นส่วนสำคัญของเว็บไซด์นี้" /></p>
</CardContent>
<CardFooter>
<Button
@@ -167,15 +161,14 @@ export default function ThanksPage() {
/>
}
>
ดูโปรไฟล์
<ExternalLinkIcon data-icon="inline-end" />
<Text message="ดูโปรไฟล์" /><ExternalLinkIcon data-icon="inline-end" />
</Button>
</CardFooter>
</Card>
))}
</section>
</section></Localized>
) : (
<div>I am sigma number one</div>
<div><Text message="I am sigma number one" /></div>
)}
</main>
<SiteFooter />