fix: localize upload status text
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
: 'bg-indigo-500 hover:bg-indigo-600 text-white'
|
||||
]"
|
||||
>
|
||||
{{ retryText }}
|
||||
{{ retryLabel }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -177,7 +177,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
totalBytes: 0,
|
||||
errorMessage: '',
|
||||
allowRetry: true,
|
||||
retryText: '重试',
|
||||
retryText: '',
|
||||
showProgressDetails: true
|
||||
})
|
||||
|
||||
@@ -188,6 +188,7 @@ const isDarkMode = useInjectedDarkMode()
|
||||
// 使用computed属性处理多语言文本
|
||||
const placeholderText = computed(() => props.placeholder || t('send.uploadArea.placeholder'))
|
||||
const descriptionText = computed(() => props.description || t('send.uploadArea.description'))
|
||||
const retryLabel = computed(() => props.retryText || t('send.uploadArea.retry'))
|
||||
const fileInput = ref<HTMLInputElement | null>(null)
|
||||
const isDragActive = ref(false)
|
||||
|
||||
@@ -204,7 +205,7 @@ const displayText = computed(() => {
|
||||
return props.selectedFiles[0].name
|
||||
}
|
||||
if (props.selectedFiles && props.selectedFiles.length > 1) {
|
||||
return `已选择 ${props.selectedFiles.length} 个文件`
|
||||
return t('send.uploadArea.selectedFiles', { count: props.selectedFiles.length })
|
||||
}
|
||||
if (props.selectedFile) {
|
||||
return props.selectedFile.name
|
||||
@@ -249,16 +250,16 @@ const statusDescription = computed(() => {
|
||||
return props.errorMessage
|
||||
}
|
||||
if (props.uploadStatus === 'initializing') {
|
||||
return '正在初始化上传...'
|
||||
return t('send.uploadArea.status.initializing')
|
||||
}
|
||||
if (props.uploadStatus === 'uploading') {
|
||||
return '正在上传文件...'
|
||||
return t('send.uploadArea.status.uploading')
|
||||
}
|
||||
if (props.uploadStatus === 'confirming') {
|
||||
return '正在确认上传...'
|
||||
return t('send.uploadArea.status.confirming')
|
||||
}
|
||||
if (isSuccess.value) {
|
||||
return '上传成功!'
|
||||
return t('send.uploadArea.status.success')
|
||||
}
|
||||
return descriptionText.value
|
||||
})
|
||||
|
||||
@@ -32,8 +32,10 @@ export function useSendFlow() {
|
||||
const isSubmitting = ref(false)
|
||||
const fileHash = ref('')
|
||||
const sendRecords = computed(() => fileDataStore.shareData)
|
||||
const uploadDescription = computed(
|
||||
() => `支持各种常见格式,最大${getStorageUnit(config.value.uploadSize)}`
|
||||
const uploadDescription = computed(() =>
|
||||
t('send.uploadArea.descriptionWithLimit', {
|
||||
size: getStorageUnit(config.value.uploadSize)
|
||||
})
|
||||
)
|
||||
const expirationOptions = computed(() =>
|
||||
config.value.expireStyle.map((value) => ({
|
||||
|
||||
@@ -215,7 +215,16 @@ export default {
|
||||
clickText: 'click to select files',
|
||||
textInput: 'Enter text to send here...',
|
||||
placeholder: 'Click or drag files here to upload',
|
||||
description: 'Supports various common formats'
|
||||
description: 'Supports various common formats',
|
||||
descriptionWithLimit: 'Supports common formats, up to {size}',
|
||||
retry: 'Retry',
|
||||
selectedFiles: '{count} files selected',
|
||||
status: {
|
||||
initializing: 'Preparing upload...',
|
||||
uploading: 'Uploading files...',
|
||||
confirming: 'Confirming upload...',
|
||||
success: 'Upload complete!'
|
||||
}
|
||||
},
|
||||
submit: 'Secure Send',
|
||||
submitting: 'Sending...',
|
||||
|
||||
@@ -217,7 +217,16 @@ export default {
|
||||
clickText: '点击选择文件',
|
||||
textInput: '在此输入要发送的文本...',
|
||||
placeholder: '点击或拖放文件到此处上传',
|
||||
description: '支持各种常见格式'
|
||||
description: '支持各种常见格式',
|
||||
descriptionWithLimit: '支持各种常见格式,最大{size}',
|
||||
retry: '重试',
|
||||
selectedFiles: '已选择 {count} 个文件',
|
||||
status: {
|
||||
initializing: '正在初始化上传...',
|
||||
uploading: '正在上传文件...',
|
||||
confirming: '正在确认上传...',
|
||||
success: '上传成功!'
|
||||
}
|
||||
},
|
||||
submit: '安全寄送',
|
||||
submitting: '发送中...',
|
||||
|
||||
Reference in New Issue
Block a user