diff --git a/src/app/(main)/do copy 2/edit/page.tsx b/src/app/(main)/do copy 2/edit/page.tsx index a3200a5..b114acc 100644 --- a/src/app/(main)/do copy 2/edit/page.tsx +++ b/src/app/(main)/do copy 2/edit/page.tsx @@ -24,7 +24,7 @@ const DoEdit: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/do copy 2/page.tsx b/src/app/(main)/do copy 2/page.tsx index 5489385..235f4e0 100644 --- a/src/app/(main)/do copy 2/page.tsx +++ b/src/app/(main)/do copy 2/page.tsx @@ -23,7 +23,7 @@ const Page: React.FC = async () => { /doworkbench

- + }> diff --git a/src/app/(main)/do copy/edit/page.tsx b/src/app/(main)/do copy/edit/page.tsx index a3200a5..b114acc 100644 --- a/src/app/(main)/do copy/edit/page.tsx +++ b/src/app/(main)/do copy/edit/page.tsx @@ -24,7 +24,7 @@ const DoEdit: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/do copy/page.tsx b/src/app/(main)/do copy/page.tsx index e1ef75d..f2004ba 100644 --- a/src/app/(main)/do copy/page.tsx +++ b/src/app/(main)/do copy/page.tsx @@ -17,7 +17,7 @@ const DeliveryOrder: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/do/edit/page.tsx b/src/app/(main)/do/edit/page.tsx index 7c7d105..b114acc 100644 --- a/src/app/(main)/do/edit/page.tsx +++ b/src/app/(main)/do/edit/page.tsx @@ -24,7 +24,7 @@ const DoEdit: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/do/page.tsx b/src/app/(main)/do/page.tsx index e21c44e..f2004ba 100644 --- a/src/app/(main)/do/page.tsx +++ b/src/app/(main)/do/page.tsx @@ -17,7 +17,7 @@ const DeliveryOrder: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/doworkbenchsearch/page.tsx b/src/app/(main)/doworkbenchsearch/page.tsx index 29fb46f..ee44fcf 100644 --- a/src/app/(main)/doworkbenchsearch/page.tsx +++ b/src/app/(main)/doworkbenchsearch/page.tsx @@ -19,7 +19,7 @@ const DoWorkbenchSearchPage: React.FC = async () => { title={t("DO Workbench Search", { defaultValue: "DO Workbench Search" })} className="mb-4" /> - + }> diff --git a/src/app/(main)/finishedGood/detail/page.tsx b/src/app/(main)/finishedGood/detail/page.tsx index eb163f1..ec11371 100644 --- a/src/app/(main)/finishedGood/detail/page.tsx +++ b/src/app/(main)/finishedGood/detail/page.tsx @@ -18,7 +18,7 @@ const PickOrder: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/finishedGood/management/page.tsx b/src/app/(main)/finishedGood/management/page.tsx index 3df9317..e754248 100644 --- a/src/app/(main)/finishedGood/management/page.tsx +++ b/src/app/(main)/finishedGood/management/page.tsx @@ -18,7 +18,7 @@ const Page = async () => { redirect("/dashboard"); } return ( - + }> diff --git a/src/app/(main)/finishedGood/page.tsx b/src/app/(main)/finishedGood/page.tsx index ff24fb1..eb0cbd9 100644 --- a/src/app/(main)/finishedGood/page.tsx +++ b/src/app/(main)/finishedGood/page.tsx @@ -17,7 +17,7 @@ const PickOrder: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/inventory/page.tsx b/src/app/(main)/inventory/page.tsx index 1701fa0..651aed9 100644 --- a/src/app/(main)/inventory/page.tsx +++ b/src/app/(main)/inventory/page.tsx @@ -30,7 +30,7 @@ const Inventory: React.FC = async () => { {t("Inventory")} - + }> diff --git a/src/app/(main)/jodetail/page.tsx b/src/app/(main)/jodetail/page.tsx index 2f33ae1..cc6af2a 100644 --- a/src/app/(main)/jodetail/page.tsx +++ b/src/app/(main)/jodetail/page.tsx @@ -18,7 +18,7 @@ const Jodetail: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/pickOrder/detail/page.tsx b/src/app/(main)/pickOrder/detail/page.tsx index 4a04ec2..7f69b70 100644 --- a/src/app/(main)/pickOrder/detail/page.tsx +++ b/src/app/(main)/pickOrder/detail/page.tsx @@ -18,7 +18,7 @@ const PickOrder: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/pickOrder/page.tsx b/src/app/(main)/pickOrder/page.tsx index 784dbdb..6f367f9 100644 --- a/src/app/(main)/pickOrder/page.tsx +++ b/src/app/(main)/pickOrder/page.tsx @@ -17,7 +17,7 @@ const PickOrder: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/po/edit/page.tsx b/src/app/(main)/po/edit/page.tsx index 48feb42..e7f0667 100644 --- a/src/app/(main)/po/edit/page.tsx +++ b/src/app/(main)/po/edit/page.tsx @@ -31,7 +31,7 @@ const PoEdit: React.FC = async ({ searchParams }) => { return ( <> {/* {t("Create Material")} */} - + }> diff --git a/src/app/(main)/production/page.tsx b/src/app/(main)/production/page.tsx index 956aac4..5708110 100644 --- a/src/app/(main)/production/page.tsx +++ b/src/app/(main)/production/page.tsx @@ -38,7 +38,7 @@ const production: React.FC = async () => { {t("Create Process")} */} - + {/* Use new component */} diff --git a/src/app/(main)/settings/deliveryOrderFloor/page.tsx b/src/app/(main)/settings/deliveryOrderFloor/page.tsx index bc1cab2..88701b1 100644 --- a/src/app/(main)/settings/deliveryOrderFloor/page.tsx +++ b/src/app/(main)/settings/deliveryOrderFloor/page.tsx @@ -11,7 +11,7 @@ export default async function DeliveryOrderFloorPage() { const { t } = await getServerI18n("deliveryOrderFloor"); return ( - + {t("title")} diff --git a/src/app/(main)/settings/masterDataIssues/page.tsx b/src/app/(main)/settings/masterDataIssues/page.tsx index ebd698f..7b4f680 100644 --- a/src/app/(main)/settings/masterDataIssues/page.tsx +++ b/src/app/(main)/settings/masterDataIssues/page.tsx @@ -13,7 +13,7 @@ const MasterDataIssuesPage: React.FC = async () => { return ( <> - + diff --git a/src/app/(main)/settings/qcCategory/page.tsx b/src/app/(main)/settings/qcCategory/page.tsx index 63f57ee..e27d2cd 100644 --- a/src/app/(main)/settings/qcCategory/page.tsx +++ b/src/app/(main)/settings/qcCategory/page.tsx @@ -36,9 +36,11 @@ const qcCategory: React.FC = async () => { {t("Create Qc Category")} - }> - - + + }> + + + ); }; diff --git a/src/app/(main)/settings/qcItem copy/create/page.tsx b/src/app/(main)/settings/qcItem copy/create/page.tsx index 1cb5c8a..b1a1bc0 100644 --- a/src/app/(main)/settings/qcItem copy/create/page.tsx +++ b/src/app/(main)/settings/qcItem copy/create/page.tsx @@ -16,7 +16,7 @@ const qcItem: React.FC = async () => { {t("Create Qc Item")} - + diff --git a/src/app/(main)/settings/qcItem copy/edit/page.tsx b/src/app/(main)/settings/qcItem copy/edit/page.tsx index 0e433fb..2529168 100644 --- a/src/app/(main)/settings/qcItem copy/edit/page.tsx +++ b/src/app/(main)/settings/qcItem copy/edit/page.tsx @@ -43,7 +43,7 @@ const qcItem: React.FC = async ({ searchParams }) => { {t("Edit Qc Item")} - + diff --git a/src/app/(main)/settings/qcItem copy/page.tsx b/src/app/(main)/settings/qcItem copy/page.tsx index f1b4e71..bc078ef 100644 --- a/src/app/(main)/settings/qcItem copy/page.tsx +++ b/src/app/(main)/settings/qcItem copy/page.tsx @@ -37,7 +37,7 @@ const qcItem: React.FC = async () => { }> - + diff --git a/src/app/(main)/settings/shop/board/page.tsx b/src/app/(main)/settings/shop/board/page.tsx index 7497344..2e47690 100644 --- a/src/app/(main)/settings/shop/board/page.tsx +++ b/src/app/(main)/settings/shop/board/page.tsx @@ -16,7 +16,7 @@ export default async function ShopRouteBoardPage() { flexDirection: "column", }} > - + }> diff --git a/src/app/(main)/settings/shop/detail/page.tsx b/src/app/(main)/settings/shop/detail/page.tsx index 817290d..7a22513 100644 --- a/src/app/(main)/settings/shop/detail/page.tsx +++ b/src/app/(main)/settings/shop/detail/page.tsx @@ -6,7 +6,7 @@ import GeneralLoading from "@/components/General/GeneralLoading"; export default async function ShopDetailPage() { await getServerI18n("shop"); return ( - + }> diff --git a/src/app/(main)/settings/shop/page.tsx b/src/app/(main)/settings/shop/page.tsx index 0caa512..50901ac 100644 --- a/src/app/(main)/settings/shop/page.tsx +++ b/src/app/(main)/settings/shop/page.tsx @@ -10,7 +10,7 @@ import { notFound } from "next/navigation"; export default async function ShopPage() { await getServerI18n("shop"); return ( - + }> diff --git a/src/app/(main)/settings/shop/truckdetail/page.tsx b/src/app/(main)/settings/shop/truckdetail/page.tsx index 1c803ee..a955368 100644 --- a/src/app/(main)/settings/shop/truckdetail/page.tsx +++ b/src/app/(main)/settings/shop/truckdetail/page.tsx @@ -6,7 +6,7 @@ import GeneralLoading from "@/components/General/GeneralLoading"; export default async function TruckLaneDetailPage() { await getServerI18n("shop"); return ( - + }> diff --git a/src/app/(main)/stockOutIssueRecord/detail/page.tsx b/src/app/(main)/stockOutIssueRecord/detail/page.tsx index 43c32fa..4c21581 100644 --- a/src/app/(main)/stockOutIssueRecord/detail/page.tsx +++ b/src/app/(main)/stockOutIssueRecord/detail/page.tsx @@ -12,7 +12,7 @@ type Props = {} & SearchParams; const StockOutIssueRecordDetail: React.FC = async ({ searchParams }) => { return ( <> - + }> diff --git a/src/app/(main)/stockOutIssueRecord/page.tsx b/src/app/(main)/stockOutIssueRecord/page.tsx index cdd4598..36d5aa3 100644 --- a/src/app/(main)/stockOutIssueRecord/page.tsx +++ b/src/app/(main)/stockOutIssueRecord/page.tsx @@ -10,7 +10,7 @@ export const metadata: Metadata = { const StockOutIssueRecord: React.FC = async () => { return ( <> - + }> diff --git a/src/app/(main)/stocktakemanagement/page.tsx b/src/app/(main)/stocktakemanagement/page.tsx index 04968eb..917a737 100644 --- a/src/app/(main)/stocktakemanagement/page.tsx +++ b/src/app/(main)/stocktakemanagement/page.tsx @@ -10,7 +10,7 @@ import { notFound } from "next/navigation"; export default async function InventoryManagementPage() { const { t } = await getServerI18n("stockTake"); return ( - + }> diff --git a/src/app/(main)/tasks/create/page.tsx b/src/app/(main)/tasks/create/page.tsx index 656139f..c14b50d 100644 --- a/src/app/(main)/tasks/create/page.tsx +++ b/src/app/(main)/tasks/create/page.tsx @@ -1,6 +1,6 @@ import { preloadAllTasks } from "@/app/api/tasks"; import CreateTaskTemplate from "@/components/CreateTaskTemplate"; -import { getServerI18n } from "@/i18n"; +import { getServerI18n, I18nProvider } from "@/i18n"; import Typography from "@mui/material/Typography"; import { Metadata } from "next"; @@ -14,8 +14,10 @@ const Projects: React.FC = async () => { return ( <> - {t("Create Task Template")} - + + {t("Create Task Template")} + + ); }; diff --git a/src/app/(main)/tasks/page.tsx b/src/app/(main)/tasks/page.tsx index b27590d..12c8bc2 100644 --- a/src/app/(main)/tasks/page.tsx +++ b/src/app/(main)/tasks/page.tsx @@ -7,6 +7,7 @@ import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { Metadata } from "next"; import Link from "next/link"; +import { I18nProvider } from "@/i18n"; import { Suspense } from "react"; export const metadata: Metadata = { @@ -37,9 +38,11 @@ const TaskTemplates: React.FC = async () => { {t("Create Template")} - }> - - + + }> + + + ); }; diff --git a/src/components/Shop/RouteBoard.tsx b/src/components/Shop/RouteBoard.tsx index 2c54a55..3313fe0 100644 --- a/src/components/Shop/RouteBoard.tsx +++ b/src/components/Shop/RouteBoard.tsx @@ -476,8 +476,10 @@ function formatLaneWarningsClipboard( } function formatDiffFieldLabel(label: string, tr: TFunction<"shop">): string { - if (label === "物流公司") return tr("diffField_logisticsCompany"); - return label; + if (label === "versionLogField_logisticId") return tr("diffField_logisticsCompany"); + // Translate i18n keys; fallback to raw label if not found + const translated = tr(label as any); + return translated !== label ? translated : label; } function downloadBase64Xlsx(base64: string, filename: string) { @@ -5598,7 +5600,7 @@ const RouteBoard: React.FC = () => { (fe, fei) => { const isLogistic = fe.label === - "物流公司"; + "versionLogField_logisticId"; const resolveLogisticDisplay = (raw: string) => { const s = String( diff --git a/src/components/Shop/Shop.tsx b/src/components/Shop/Shop.tsx index 14876fd..a78aac8 100644 --- a/src/components/Shop/Shop.tsx +++ b/src/components/Shop/Shop.tsx @@ -317,7 +317,7 @@ const Shop: React.FC = () => { {t("ShopAndTruck")} diff --git a/src/components/Shop/routeBoardVersionLog.ts b/src/components/Shop/routeBoardVersionLog.ts index d6f866b..8482ad8 100644 --- a/src/components/Shop/routeBoardVersionLog.ts +++ b/src/components/Shop/routeBoardVersionLog.ts @@ -54,18 +54,18 @@ function isRowInsertedInDiff(ch: DiffFieldChange[]): boolean { return laneOk && codeOk; } -export const VERSION_LOG_LOADING_SEQUENCE_LABEL = "裝載順序"; +export const VERSION_LOG_LOADING_SEQUENCE_LABEL = "versionLogField_loadingSequence"; const VERSION_LOG_FIELD_LABEL: Record = { - departureTime: "發車時段", + departureTime: "versionLogField_departureTime", loadingSequence: VERSION_LOG_LOADING_SEQUENCE_LABEL, - branchName: "分店名稱", - districtReference: "區域", - shopCode: "店鋪代碼", - storeId: "樓層/店別", - remark: "備註", - truckLanceCode: "車線代碼", - logisticId: "物流公司", + branchName: "versionLogField_branchName", + districtReference: "versionLogField_districtReference", + shopCode: "versionLogField_shopCode", + storeId: "versionLogField_storeId", + remark: "versionLogField_remark", + truckLanceCode: "versionLogField_truckLanceCode", + logisticId: "versionLogField_logisticId", }; /** 版本 LOG 用:時段顯示為 HH:mm,避免 ISO / 帶秒過長 */ diff --git a/src/i18n/en/shop.json b/src/i18n/en/shop.json index 9d9cfdc..6b864aa 100644 --- a/src/i18n/en/shop.json +++ b/src/i18n/en/shop.json @@ -458,5 +458,14 @@ "Truck ID is required": "Truck ID is required", "Are you sure you want to delete this truck lane?": "Are you sure you want to delete this truck lane?", "Search or select branch": "Search or select branch", - "Search or select shop code": "Search or select shop code" + "Search or select shop code": "Search or select shop code", + "versionLogField_departureTime": "Departure time", + "versionLogField_loadingSequence": "Load sequence", + "versionLogField_branchName": "Branch name", + "versionLogField_districtReference": "District", + "versionLogField_shopCode": "Shop code", + "versionLogField_storeId": "Floor / Store", + "versionLogField_remark": "Remark", + "versionLogField_truckLanceCode": "Lane code", + "versionLogField_logisticId": "Logistics" } diff --git a/src/i18n/zh/shop.json b/src/i18n/zh/shop.json index 501b01f..6f34ecd 100644 --- a/src/i18n/zh/shop.json +++ b/src/i18n/zh/shop.json @@ -458,5 +458,14 @@ "Truck ID is required": "需要卡車ID", "Are you sure you want to delete this truck lane?": "您確定要刪除此車線嗎?", "Search or select branch": "搜索或選擇分店", - "Search or select shop code": "搜索或選擇店鋪編號" + "Search or select shop code": "搜索或選擇店鋪編號", + "versionLogField_departureTime": "發車時段", + "versionLogField_loadingSequence": "裝載順序", + "versionLogField_branchName": "分店名稱", + "versionLogField_districtReference": "區域", + "versionLogField_shopCode": "店鋪代碼", + "versionLogField_storeId": "樓層/店別", + "versionLogField_remark": "備註", + "versionLogField_truckLanceCode": "車線代碼", + "versionLogField_logisticId": "物流公司" }