diff --git a/frontend/src/components/FilePreviewModal.vue b/frontend/src/components/FilePreviewModal.vue index 98903c12..8e784e12 100644 --- a/frontend/src/components/FilePreviewModal.vue +++ b/frontend/src/components/FilePreviewModal.vue @@ -9,6 +9,7 @@ * - 对 Office 文档在可公网 HTTPS 访问时走 Office 在线预览,否则降级为打开/下载 */ import { computed, ref, watch } from 'vue'; +import { useI18n } from 'vue-i18n'; import { marked } from 'marked'; import * as XLSX from 'xlsx'; import { useMessage } from '../composables/useMessage'; @@ -44,6 +45,7 @@ const emit = defineEmits<{ (e: 'update:modelValue', value: boolean): void; }>(); const msg = useMessage(); +const { t } = useI18n(); const isLoading = ref(false); const error = ref(''); @@ -146,7 +148,7 @@ const downloadFile = async () => { URL.revokeObjectURL(url); } catch (err: any) { console.error('Download failed:', err); - msg.error('下载失败: ' + (err.message || '未知错误')); + msg.error(t('filePreview.msg.downloadFailed', { reason: err.message || t('filePreview.msg.unknownError') })); } finally { isDownloading.value = false; } @@ -419,7 +421,7 @@ watch(
-
文件预览
+
{{ t('filePreview.title') }}
{{ file.name }}
- +
-
加载中...
+
{{ t('common.loading') }}
- {{ isDownloading ? '下载中...' : '下载文件' }} + {{ isDownloading ? t('filePreview.downloading') : t('filePreview.download') }}
diff --git a/frontend/src/components/GeneralFeedbackDialog.vue b/frontend/src/components/GeneralFeedbackDialog.vue index 60a8d4a6..0ced6c5a 100644 --- a/frontend/src/components/GeneralFeedbackDialog.vue +++ b/frontend/src/components/GeneralFeedbackDialog.vue @@ -1,5 +1,6 @@ -