From f58ca8144f62a09bd22890712a2e8704bb2c67d3 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Fri, 27 Jun 2025 13:45:30 +0800 Subject: [PATCH] i18n --- .../RoughScheduleDetail/ViewByBomDetails.tsx | 2 +- .../SearchResults/EditableSearchResults.tsx | 4 ++-- .../SearchResults/TempInputGridForMockUp.tsx | 11 +++++++---- src/i18n/zh/home.json | 4 ++++ src/i18n/zh/project.json | 9 ++++++++- src/i18n/zh/schedule.json | 3 +++ 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/i18n/zh/home.json diff --git a/src/components/RoughScheduleDetail/ViewByBomDetails.tsx b/src/components/RoughScheduleDetail/ViewByBomDetails.tsx index fa3866d..b693bda 100644 --- a/src/components/RoughScheduleDetail/ViewByBomDetails.tsx +++ b/src/components/RoughScheduleDetail/ViewByBomDetails.tsx @@ -509,7 +509,7 @@ const ViewByBomDetails: React.FC = ({ apiRef, isEdit }) => { } }, ], - [t] + [] ); return ( diff --git a/src/components/SearchResults/EditableSearchResults.tsx b/src/components/SearchResults/EditableSearchResults.tsx index 8e164f6..f90a715 100644 --- a/src/components/SearchResults/EditableSearchResults.tsx +++ b/src/components/SearchResults/EditableSearchResults.tsx @@ -159,7 +159,7 @@ function EditableSearchResults({ onClick={() => setOpen(!open)} > {open ? : } - View BoM + {t("View BoM")} } @@ -184,7 +184,7 @@ function EditableSearchResults({ onClick={() => setOpen(!open)} > {open ? : } - View BoM + {t("View BoM")} } diff --git a/src/components/SearchResults/TempInputGridForMockUp.tsx b/src/components/SearchResults/TempInputGridForMockUp.tsx index ed6d5a1..dc53233 100644 --- a/src/components/SearchResults/TempInputGridForMockUp.tsx +++ b/src/components/SearchResults/TempInputGridForMockUp.tsx @@ -74,7 +74,7 @@ class ProcessRowUpdateError extends Error { } function TempInputGridForMockUp({ stockInLine }: Props) { - const { t } = useTranslation("home"); + const { t } = useTranslation("schedule"); const apiRef = useGridApiRef(); const [rowModesModel, setRowModesModel] = useState({}); const getRowId = useCallback>( @@ -169,19 +169,22 @@ function TempInputGridForMockUp({ stockInLine }: Props) { () => [ { field: "code", + headerName: t("Code"), flex: 1, }, { field: "name", + headerName: t("Name"), flex: 1, }, { field: "type", + headerName: t("type"), flex: 1, }, { field: "inStockQty", - headerName: "Available Qty", + headerName: t("Available Qty"), flex: 0.5, type: "number", editable: true, @@ -194,7 +197,7 @@ function TempInputGridForMockUp({ stockInLine }: Props) { }, { field: "purchaseQty", - headerName: "Demand Qty", + headerName: t("Demand Qty"), flex: 0.5, editable: true, align: "right", @@ -205,7 +208,7 @@ function TempInputGridForMockUp({ stockInLine }: Props) { }, { field: "status", - headerName: "status", + headerName: t("status"), flex: 0.5, editable: true, align: "center", diff --git a/src/i18n/zh/home.json b/src/i18n/zh/home.json new file mode 100644 index 0000000..5c6e51e --- /dev/null +++ b/src/i18n/zh/home.json @@ -0,0 +1,4 @@ +{ + "Demand Qty": "需求數量" + +} \ No newline at end of file diff --git a/src/i18n/zh/project.json b/src/i18n/zh/project.json index 4555647..f69ec5c 100644 --- a/src/i18n/zh/project.json +++ b/src/i18n/zh/project.json @@ -4,5 +4,12 @@ "Release": "發佈", "Actions": "動作", "Product": "產品", - "Details": "詳情" + "Details": "詳情", + "View BoM": "查看 BoM" + + + + + + } \ No newline at end of file diff --git a/src/i18n/zh/schedule.json b/src/i18n/zh/schedule.json index 3f089dd..5b51d5f 100644 --- a/src/i18n/zh/schedule.json +++ b/src/i18n/zh/schedule.json @@ -16,8 +16,11 @@ "Search": "搜尋", "Reset": "重置", "name": "名稱", + "Name": "名稱", "type": "類型", "code": "編號", + "Code": "編號", + "CODE": "編號", "Product Count": "產品數量", "Scheduled At": "排程時間", "Demand Forecast Period": "需求預測期間",