diff options
Diffstat (limited to 'components/documents/project-swicher.tsx')
| -rw-r--r-- | components/documents/project-swicher.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/components/documents/project-swicher.tsx b/components/documents/project-swicher.tsx index 5c70ea88..45300b56 100644 --- a/components/documents/project-swicher.tsx +++ b/components/documents/project-swicher.tsx @@ -1,7 +1,9 @@ "use client" import * as React from "react" +import { useParams } from "next/navigation" import { cn } from "@/lib/utils" +import { useTranslation } from "@/i18n/client" import { Select, SelectContent, @@ -54,6 +56,10 @@ export function ProjectSwitcher({ selectedContractId, onSelectContract, }: ProjectSwitcherProps) { + const params = useParams() + const lng = (params?.lng as string) || "ko" + const { t } = useTranslation(lng, "engineering") + // Select value = stringified contractId const selectValue = selectedContractId ? String(selectedContractId) : "" @@ -69,8 +75,8 @@ export function ProjectSwitcher({ return null }, [projects, selectedContractId]) - // Trigger Label => 계약 이름 or "Select a contract" - const triggerLabel = selectedContract?.contractName ?? "Select a contract" + // Trigger Label => 계약 이름 or placeholder + const triggerLabel = selectedContract?.contractName ?? t("vendorDocuments.projectSwitcher.selectContractPlaceholder") function handleValueChange(val: string) { const contractId = Number(val) @@ -98,9 +104,9 @@ export function ProjectSwitcher({ isCollapsed && "flex h-9 w-9 shrink-0 items-center justify-center p-0", "max-w-[300px] whitespace-nowrap overflow-hidden text-ellipsis" )} - aria-label="Select Contract" + aria-label={t("vendorDocuments.projectSwitcher.selectContract")} > - <SelectValue placeholder="Select a contract"> + <SelectValue placeholder={t("vendorDocuments.projectSwitcher.selectContractPlaceholder")}> {/* 실제 표시부분에도 ellipsis 처리. */} <span className={cn( |
