summaryrefslogtreecommitdiff
path: root/components/notice/notice-edit-sheet.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-08-21 06:57:36 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-08-21 06:57:36 +0000
commit02b1cf005cf3e1df64183d20ba42930eb2767a9f (patch)
treee932c54d5260b0e6fda2b46be2a6ba1c3ee30434 /components/notice/notice-edit-sheet.tsx
parentd78378ecd7ceede1429359f8058c7a99ac34b1b7 (diff)
(대표님, 최겸) 설계메뉴추가, 작업사항 업데이트
설계메뉴 - 문서관리 설계메뉴 - 벤더 데이터 gtc 메뉴 업데이트 정보시스템 - 메뉴리스트 및 정보 업데이트 파일 라우트 업데이트 엑셀임포트 개선 기본계약 개선 벤더 가입과정 변경 및 개선 벤더 기본정보 - pq 돌체 오류 수정 및 개선 벤더 로그인 과정 이메일 오류 수정
Diffstat (limited to 'components/notice/notice-edit-sheet.tsx')
-rw-r--r--components/notice/notice-edit-sheet.tsx23
1 files changed, 22 insertions, 1 deletions
diff --git a/components/notice/notice-edit-sheet.tsx b/components/notice/notice-edit-sheet.tsx
index 91bcae3b..dc83d23a 100644
--- a/components/notice/notice-edit-sheet.tsx
+++ b/components/notice/notice-edit-sheet.tsx
@@ -3,6 +3,8 @@
import * as React from "react"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
+import { useParams } from "next/navigation"
+import { useTranslation } from "@/i18n/client"
import { toast } from "sonner"
import { Button } from "@/components/ui/button"
@@ -57,6 +59,25 @@ export function UpdateNoticeSheet({
pagePathOptions,
onSuccess
}: UpdateNoticeSheetProps) {
+ const params = useParams()
+ const lng = (params?.lng as string) || 'ko'
+ const { t } = useTranslation(lng, 'menu')
+
+ // 안전한 번역 함수 (키가 없을 때 원본 키 반환)
+ const safeTranslate = (key: string): string => {
+ try {
+ const translated = t(key)
+ // 번역 키가 그대로 반환되는 경우 원본 키 사용
+ if (translated === key) {
+ return key
+ }
+ return translated || key
+ } catch (error) {
+ console.warn(`Translation failed for key: ${key}`, error)
+ return key
+ }
+ }
+
const [isUpdatePending, startUpdateTransition] = React.useTransition()
const form = useForm<UpdateNoticeSchema>({
@@ -149,7 +170,7 @@ export function UpdateNoticeSheet({
<SelectContent>
{pagePathOptions.map((option) => (
<SelectItem key={option.value} value={option.value}>
- {option.label}
+ {safeTranslate(option.label)}
</SelectItem>
))}
</SelectContent>