feat: 文档下载页的i18n适配

This commit is contained in:
2025-11-04 14:13:46 +08:00
parent 085fd8bad3
commit b7bb0cfff8
4 changed files with 26 additions and 10 deletions

View File

@ -8,15 +8,17 @@
</template>
<dl class="text-gray-600 space-y-1 mb-6">
<div>
<dt class="font-semibold inline">类型</dt>
<dt class="font-semibold inline">{{ $t('document-meta.type') }}</dt>
<dd class="inline">{{ file.type }}</dd>
</div>
<div>
<dt class="font-semibold inline">大小</dt>
<dt class="font-semibold inline">{{ $t('document-meta.size') }}</dt>
<dd class="inline">{{ formatFileSize(file.filesize) }}</dd>
</div>
<div>
<dt class="font-semibold inline">上传时间</dt>
<dt class="font-semibold inline">
{{ $t('document-meta.upload-at') }}
</dt>
<dd class="inline">
{{ new Date(file.uploaded_on).toLocaleDateString() }}
</dd>
@ -24,10 +26,12 @@
</dl>
<template #footer>
<div class="button-group">
<el-button type="primary" @click="handleDownload">下载</el-button>
<el-button v-if="file.previewable" @click="handlePreview"
>预览</el-button
>
<el-button type="primary" @click="handleDownload">{{
$t('document-action.download')
}}</el-button>
<el-button v-if="file.previewable" @click="handlePreview">{{
$t('document-action.preview')
}}</el-button>
</div>
</template>
</el-card>

View File

@ -1,7 +1,7 @@
<template>
<div class="page-container">
<div class="page-header">
<h1 class="page-title">文件下载</h1>
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div v-if="!pending" class="page-content">

View File

@ -81,6 +81,12 @@
},
"document-meta": {
"size": "Size",
"format": "Format"
"format": "Format",
"type": "Type",
"upload-at": "Upload at"
},
"document-action": {
"download": "Download",
"preview": "Preview"
}
}

View File

@ -80,6 +80,12 @@
},
"document-meta": {
"size": "大小",
"format": "格式"
"format": "格式",
"type": "类型",
"upload-at": "上传时间"
},
"document-action": {
"download": "下载",
"preview": "预览"
}
}