fix(files): close preview on navigation/delete/rename + backfill i18n (#150)

* i18n: backfill files/download translations for de, es, fr, ja, ko, pt

Add nav.files, files.* (39 keys), and download.* (9 keys) so the file
browser UI is fully localized in these six locales instead of falling
back to English.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(files): close preview when navigating or affected file changes

Opening a preview and then navigating directories, deleting the
previewed file, or renaming it left the preview pane stuck on stale
content because previewFile was never cleared.

- stores/hermes/files.ts:
  - fetchEntries clears previewFile on path change (in-place refresh
    keeps the preview).
  - deleteEntry / renameEntry clear preview/editor state when the
    affected entry matches the previewed/edited file or its parent.
  - Add isAffected(target, changed, isDir) helper.
- components/hermes/files/FilePreview.vue: replace the misleading
  common.cancel close button with a dedicated files.closePreview key
  plus an X icon and quaternary style.
- i18n: add files.closePreview to all 8 locales.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
ww
2026-04-23 14:10:14 +08:00
committed by GitHub
parent 93719fb04b
commit a4bfd8edd3
10 changed files with 427 additions and 39 deletions
+64 -6
View File
@@ -75,6 +75,7 @@ export default {
usage: '사용량',
channels: '채널',
terminal: '터미널',
files: '파일',
settings: '설정',
connected: '연결됨',
disconnected: '연결 끊김',
@@ -84,7 +85,6 @@ export default {
updateSuccess: '업데이트 완료, 서버를 재시작해 주세요',
updateFailed: '업데이트 실패',
logout: '로그아웃',
nodeVersionWarning: 'Node.js v{version}이(가) 감지되었습니다. 전체 기능에는 버전 23+가 필요합니다(SQLite, node-pty).',
changelog: '변경 이력',
noChangelog: '변경 이력이 없습니다',
},
@@ -511,11 +511,6 @@ export default {
// 변경 이력
changelog: {
new_0_4_4_1: '파일 브라우저 추가 (local/Docker/SSH/Singularity 지원)',
new_0_4_4_2: '채팅 메시지 첨부 파일 다운로드 추가',
new_0_4_4_3: '활성 세션에 라이브 배지 표시',
new_0_4_4_4: 'StepFun 및 Nous Portal 프로바이더 지원 추가',
new_0_4_4_5: '특수문자 검색 시 500 에러 수정',
new_0_4_3_1: '토큰 인증과 함께 사용자 이름/비밀번호 로그인 추가',
new_0_4_3_2: '자격 증명 관리를 위한 계정 설정 추가',
new_0_4_3_3: '사이드바에 로그아웃 버튼 추가',
@@ -527,4 +522,67 @@ export default {
new_0_4_2_5: '내장 프로바이더 감지 및 모델 매칭 수정',
new_0_4_1_1: '인증 우회 및 SPA 파일 서비스 수정',
},
// 파일
files: {
title: '파일',
tree: '디렉터리 트리',
list: '파일 목록',
breadcrumbRoot: '홈',
newFile: '새 파일',
newFolder: '새 폴더',
upload: '업로드',
refresh: '새로고침',
open: '열기',
edit: '편집',
preview: '미리보기',
download: '다운로드',
copyPath: '경로 복사',
rename: '이름 변경',
delete: '삭제',
name: '이름',
size: '크기',
modified: '수정일',
actions: '작업',
emptyDir: '빈 디렉터리',
loading: '불러오는 중...',
confirmDelete: '"{name}"을(를) 삭제하시겠습니까?',
confirmDeleteDir: '디렉터리 "{name}"과 그 내부 항목을 모두 삭제하시겠습니까?',
deleteFailed: '삭제 실패',
deleted: '삭제됨',
renameTo: '새 이름',
newFileName: '파일 이름',
newFolderName: '폴더 이름',
created: '생성됨',
createFailed: '생성 실패',
renamed: '이름이 변경됨',
renameFailed: '이름 변경 실패',
uploadSuccess: '{count}개 파일이 업로드되었습니다',
uploadFailed: '업로드 실패',
saveFailed: '저장 실패',
saved: '저장됨',
unsavedChanges: '저장하지 않은 변경 사항이 있습니다. 취소하시겠습니까?',
pathCopied: '경로가 복사되었습니다',
fileTooLarge: '파일이 너무 큽니다 (최대 10MB)',
permissionDenied: '보호된 파일은 수정할 수 없습니다',
notFound: '파일 또는 디렉터리를 찾을 수 없습니다',
backendError: '파일 작업 실패',
dragDropHint: '여기로 파일을 드래그하여 업로드',
closeEditor: '편집기 닫기',
closePreview: '닫기',
saveFile: '저장',
},
// 다운로드
download: {
downloading: '다운로드 중...',
downloadFailed: '다운로드 실패',
fileNotFound: '파일을 찾을 수 없거나 삭제되었습니다',
fileTooLarge: '파일이 너무 큽니다 (제한 초과)',
backendError: '파일 읽기에 실패했습니다. 원격 환경이 사용 불가능할 수 있습니다',
backendTimeout: '파일 읽기 시간 초과',
unsupportedBackend: '현재 터미널 백엔드는 파일 다운로드를 지원하지 않습니다',
invalidPath: '잘못된 파일 경로',
download: '다운로드',
},
}