🌐 Localize attachment uploader

This commit is contained in:
LittleSheep 2024-08-23 02:11:00 +08:00
parent afd7d6b444
commit 7b0b5d4704
5 changed files with 23 additions and 9 deletions

View File

@ -67,5 +67,12 @@
"embedWidget": "Solar Network Embed Widget",
"continueReading": "Continue Reading",
"download": "Download",
"downloadDescription": "Pick the right version for you"
"downloadDescription": "Pick the right version for you",
"attachmentUpload": "Upload new",
"attachmentCreate": "Create Attachment",
"attachmentCreateCaption": "Use Solar Network host your files",
"attachmentUploadProgress": "Uploading",
"attachmentUploadCompleted": "Uploaded",
"upload": "Upload",
"cancel": "Cancel"
}

View File

@ -67,5 +67,12 @@
"embedWidget": "Solar Network 嵌入式组件",
"continueReading": "继续阅读",
"download": "下载",
"downloadDescription": "选择适合你的版本下载"
"downloadDescription": "选择适合你的版本下载",
"attachmentUpload": "新传附件",
"attachmentCreate": "新建附件",
"attachmentCreateCaption": "使用 Solar Network 来托管你的文件",
"attachmentUploadProgress": "上传中",
"attachmentUploadCompleted": "上传完成",
"upload": "上传",
"cancel": "取消"
}

View File

@ -1,5 +1,5 @@
<template>
<v-app-bar flat color="primary" scroll-behavior="hide">
<v-app-bar flat color="primary" scroll-behavior="hide" scroll-threshold="800">
<v-container fluid class="mx-auto d-flex align-center justify-center px-8">
<nuxt-link to="/" exact>
<v-img class="me-4 ms-1" width="32" height="32" alt="Logo" :src="Logo" />

View File

@ -4,7 +4,7 @@
<h1 class="text-2xl">{{ t("navGallery") }}</h1>
<p>{{ t("navGalleryCaption") }}</p>
<v-btn slim size="x-small" prepend-icon="mdi-upload" variant="text" color="info" to="/gallery/new">
<span>Upload new</span>
{{ t("attachmentUpload") }}
</v-btn>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div class="h-[calc(100vh-80px)] flex flex-col justify-center items-center">
<h1 class="text-2xl font-bold">Create Attachment</h1>
<p>Use Solar Network host your files</p>
<h1 class="text-2xl font-bold">{{ t("attachmentCreate") }}</h1>
<p>{{ t("attachmentCreateCaption") }}</p>
<div class="my-5 w-[640px]">
<v-expand-transition>
@ -35,7 +35,7 @@
<v-expand-transition>
<div v-if="multipartProgress.value" class="text-center flex flex-col">
<span class="text-sm">
{{ success ? "Uploaded" : "Uploading" }}
{{ success ? t("attachmentUploadCompleted") : t("attachmentUploadProgress") }}
{{ multipartProgress.current }}/{{ multipartProgress.total }}
{{ (multipartProgress.value * 100).toFixed(2) }}%
</span>
@ -60,8 +60,8 @@
</div>
<div class="flex">
<v-btn text="Upload" prepend-icon="mdi-upload" variant="plain" :loading="loading" @click="submit" />
<v-btn text="Cancel" color="grey" append-icon="mdi-exit-to-app" variant="plain" to="/gallery"
<v-btn :text="t('upload')" prepend-icon="mdi-upload" variant="plain" :loading="loading" @click="submit" />
<v-btn :text="t('cancel')" color="grey" append-icon="mdi-exit-to-app" variant="plain" to="/gallery"
:disabled="loading" />
</div>