diff --git a/frontend/src/components/StorageRow.tsx b/frontend/src/components/StorageRow.tsx index 630d83c..b741e3a 100644 --- a/frontend/src/components/StorageRow.tsx +++ b/frontend/src/components/StorageRow.tsx @@ -5,12 +5,15 @@ import { useStore } from "@tanstack/react-store"; import { Input, Button } from "@mui/joy"; import type { Storage } from "../misc/interfaces"; import { formatDate } from "../utils/uxFncs"; +import { useTranslation } from "react-i18next"; interface StorageRowProps { storage: Storage; } export const StorageRow = ({ storage }: StorageRowProps) => { + const { t } = useTranslation(); + const queryClient = useQueryClient(); const mutation = useMutation({ @@ -90,7 +93,7 @@ export const StorageRow = ({ storage }: StorageRowProps) => { size="sm" className="rounded-xl" > - {mutation.isPending ? "..." : "Save"} + {mutation.isPending ? "..." : t("save")} diff --git a/frontend/src/pages/AddProduct.tsx b/frontend/src/pages/AddProduct.tsx index 5a644ac..154a4f4 100644 --- a/frontend/src/pages/AddProduct.tsx +++ b/frontend/src/pages/AddProduct.tsx @@ -57,7 +57,7 @@ export const AddProduct = () => { {t("add-product")} - {t("inventory-header")} + {t("add-product-subtitle")} { { id: "stock", label: t("stock"), numeric: true }, { id: "location", label: t("storage-place"), numeric: false }, { id: "expiryDate", label: t("expiry-date"), numeric: false }, - { id: "refillDate", label: t("refill-date"), numeric: false }, + { id: "refillDate", label: t("bottling-date"), numeric: false }, ]; return ( @@ -175,7 +175,7 @@ const EnhancedTableHead = (props: EnhancedTableHeadProps) => { ); })} - Aktionen + {t("actions")} ); @@ -251,13 +251,11 @@ export const InventoryPage = () => { (product: any, index: number) => ({ id: String(product?.uuid ?? index), uuid: String(product?.uuid ?? ""), - name: product?.name ?? "Produktname", + name: product?.name ?? t("product-name"), description: product?.description ?? "", imageUrl: product?.picture ?? undefined, price: product?.price ?? "-", stock: `${product?.amount ?? 0} Stk.`, - stockLabel: product?.amount === 0 ? "FEHLT" : "OK", - stockStatus: product?.amount === 0 ? "missing" : "ok", location: product?.storage_location_name ?? "-", locationDetail: "", expiryDate: formatDate(product?.expiry_date), @@ -272,7 +270,7 @@ export const InventoryPage = () => { const [rowsPerPage, setRowsPerPage] = React.useState(5); const handleRequestSort = ( - event: React.MouseEvent, + _event: React.MouseEvent, property: keyof ProductRow, ) => { const isAsc = orderBy === property && order === "asc"; @@ -289,7 +287,7 @@ export const InventoryPage = () => { setSelected([]); }; - const handleClick = (event: React.MouseEvent, id: string) => { + const handleClick = (_event: React.MouseEvent, id: string) => { const selectedIndex = selected.indexOf(id); let newSelected: readonly string[] = []; if (selectedIndex === -1) { @@ -311,7 +309,7 @@ export const InventoryPage = () => { setPage(newPage); }; - const handleChangeRowsPerPage = (event: any, newValue: number | null) => { + const handleChangeRowsPerPage = (_event: any, newValue: number | null) => { setRowsPerPage(parseInt(newValue!.toString(), 10)); setPage(0); }; @@ -330,8 +328,8 @@ export const InventoryPage = () => { return ( <> - {t("inventory-subtitle")} - {t("inventory-header")} + {t("inventory")} + {t("inventory-subtitle")}