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: 'ダウンロード',
},
}