feat(i18n) : add personal languages and compact weapon exports
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "@/components/i18n/locale-provider";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import type { MouseEvent } from "react";
|
||||
@@ -27,15 +28,16 @@ export function GuideSectionNav({
|
||||
current: string;
|
||||
extras: Array<{ id: string; slug: string; title: string }>;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const confirmNavigation = (event: MouseEvent<HTMLAnchorElement>) => {
|
||||
const browserWindow = window as Window & { __guideHasUnsavedChanges?: boolean };
|
||||
if (typeof window !== "undefined" && browserWindow.__guideHasUnsavedChanges && !window.confirm("ข้อมูลยังบันทึกไม่เสร็จหรือไม่ถูกต้อง ต้องการออกจากหน้านี้หรือไม่?")) {
|
||||
if (typeof window !== "undefined" && browserWindow.__guideHasUnsavedChanges && !window.confirm(t("ข้อมูลยังบันทึกไม่เสร็จหรือไม่ถูกต้อง ต้องการออกจากหน้านี้หรือไม่?"))) {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<ScrollableNav
|
||||
ariaLabel="เมนูแก้ไข Guide"
|
||||
ariaLabel={t("เมนูแก้ไข Guide")}
|
||||
className="w-full rounded-xl border bg-card p-2"
|
||||
>
|
||||
<Link
|
||||
@@ -48,8 +50,7 @@ export function GuideSectionNav({
|
||||
)}
|
||||
>
|
||||
<Image src={navigationIconPath("overview")!} alt="" width={20} height={20} className="size-5 object-contain" />
|
||||
Overview
|
||||
</Link>
|
||||
{t("Overview")}</Link>
|
||||
{sections.map((section) => {
|
||||
const iconPath = navigationIconPath(section.slug);
|
||||
return (
|
||||
@@ -64,7 +65,7 @@ export function GuideSectionNav({
|
||||
)}
|
||||
>
|
||||
{iconPath ? <Image src={iconPath} alt="" width={20} height={20} className="size-5 object-contain" /> : null}
|
||||
{section.label}
|
||||
{t(section.label)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user