From 4586f2cd95f1cd7112cbec80399da8817df0d289 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 25 Nov 2025 15:42:00 +0900
Subject: (김준회) dolce: i18n 적용, 상세도면 수정 적용
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../dialogs/upload-files-to-detail-dialog.tsx      | 35 ++++++++++++----------
 1 file changed, 19 insertions(+), 16 deletions(-)

(limited to 'lib/dolce/dialogs/upload-files-to-detail-dialog.tsx')

diff --git a/lib/dolce/dialogs/upload-files-to-detail-dialog.tsx b/lib/dolce/dialogs/upload-files-to-detail-dialog.tsx
index 09f68614..e8d82129 100644
--- a/lib/dolce/dialogs/upload-files-to-detail-dialog.tsx
+++ b/lib/dolce/dialogs/upload-files-to-detail-dialog.tsx
@@ -14,6 +14,7 @@ import { Button } from "@/components/ui/button";
 import { Alert, AlertDescription } from "@/components/ui/alert";
 import { Upload, FolderOpen, Loader2, X, FileText, AlertCircle } from "lucide-react";
 import { toast } from "sonner";
+import { useTranslation } from "@/i18n/client";
 import { useFileUploadWithProgress } from "../hooks/use-file-upload-with-progress";
 import { uploadFilesWithProgress, type UploadResult } from "../utils/upload-with-progress";
 import { FileUploadProgressList } from "../components/file-upload-progress-list";
@@ -26,7 +27,7 @@ interface UploadFilesToDetailDialogProps {
   revNo: string;
   userId: string;
   onUploadComplete?: () => void;
-  lng?: string; // i18n support
+  lng: string;
 }
 
 export function UploadFilesToDetailDialog({
@@ -37,7 +38,9 @@ export function UploadFilesToDetailDialog({
   revNo,
   userId,
   onUploadComplete,
+  lng,
 }: UploadFilesToDetailDialogProps) {
+  const { t } = useTranslation(lng, "dolce");
   const [isUploading, setIsUploading] = useState(false);
 
   // 파일 업로드 훅 사용 (진행도 추적)
@@ -62,7 +65,7 @@ export function UploadFilesToDetailDialog({
   // 업로드 처리
   const handleUpload = async () => {
     if (selectedFiles.length === 0) {
-      toast.error("파일을 선택해주세요");
+      toast.error(t("uploadFilesDialog.selectFilesError"));
       return;
     }
 
@@ -93,16 +96,16 @@ export function UploadFilesToDetailDialog({
       });
 
       if (result.success) {
-        toast.success(`${result.uploadedCount}개 파일 업로드 완료`);
+        toast.success(t("uploadFilesDialog.uploadSuccess", { count: result.uploadedCount }));
         onOpenChange(false);
         onUploadComplete?.();
       } else {
-        toast.error(result.error || "업로드 실패");
+        toast.error(result.error || t("uploadFilesDialog.uploadError"));
       }
     } catch (error) {
       console.error("업로드 실패:", error);
       toast.error(
-        error instanceof Error ? error.message : "업로드 중 오류가 발생했습니다"
+        error instanceof Error ? error.message : t("uploadFilesDialog.uploadErrorMessage")
       );
     } finally {
       setIsUploading(false);
@@ -113,9 +116,9 @@ export function UploadFilesToDetailDialog({
     <Dialog open={open} onOpenChange={onOpenChange}>
       <DialogContent className="max-w-2xl">
         <DialogHeader>
-          <DialogTitle>파일 업로드</DialogTitle>
+          <DialogTitle>{t("uploadFilesDialog.title")}</DialogTitle>
           <DialogDescription>
-            {drawingNo} - Rev. {revNo}에 파일을 업로드합니다
+            {t("uploadFilesDialog.description", { drawingNo, revNo })}
           </DialogDescription>
         </DialogHeader>
 
@@ -124,7 +127,7 @@ export function UploadFilesToDetailDialog({
           <Alert>
             <AlertCircle className="h-4 w-4" />
             <AlertDescription>
-              선택한 상세도면의 UploadId에 파일을 추가합니다. 파일 업로드 후 자동으로 메타데이터가 저장됩니다.
+              {t("uploadFilesDialog.alertMessage")}
             </AlertDescription>
           </Alert>
 
@@ -152,11 +155,11 @@ export function UploadFilesToDetailDialog({
                 }`}
               >
                 {isDragActive
-                  ? "파일을 여기에 놓으세요"
-                  : "클릭하거나 파일을 드래그하여 선택"}
+                  ? t("uploadFilesDialog.dropHereText")
+                  : t("uploadFilesDialog.dragDropText")}
               </p>
               <p className="text-xs text-muted-foreground mt-1">
-                여러 파일을 한 번에 업로드할 수 있습니다 (최대 1GB/파일)
+                {t("uploadFilesDialog.fileInfo")}
               </p>
             </div>
           </div>
@@ -172,14 +175,14 @@ export function UploadFilesToDetailDialog({
                 <>
                   <div className="flex items-center justify-between mb-3">
                     <h4 className="text-sm font-medium">
-                      선택된 파일 ({selectedFiles.length}개)
+                      {t("uploadFilesDialog.selectedFiles", { count: selectedFiles.length })}
                     </h4>
                     <Button
                       variant="ghost"
                       size="sm"
                       onClick={clearFiles}
                     >
-                      전체 제거
+                      {t("uploadFilesDialog.removeAll")}
                     </Button>
                   </div>
                   <div className="max-h-60 overflow-y-auto space-y-2">
@@ -219,7 +222,7 @@ export function UploadFilesToDetailDialog({
             onClick={() => onOpenChange(false)}
             disabled={isUploading}
           >
-            취소
+            {t("uploadFilesDialog.cancelButton")}
           </Button>
           <Button
             onClick={handleUpload}
@@ -228,12 +231,12 @@ export function UploadFilesToDetailDialog({
             {isUploading ? (
               <>
                 <Loader2 className="mr-2 h-4 w-4 animate-spin" />
-                업로드 중...
+                {t("uploadFilesDialog.uploadingButton")}
               </>
             ) : (
               <>
                 <Upload className="mr-2 h-4 w-4" />
-                업로드 ({selectedFiles.length}개)
+                {t("uploadFilesDialog.uploadButton", { count: selectedFiles.length })}
               </>
             )}
           </Button>
-- 
cgit v1.2.3

