forked from BRETT/BRETT
i18n implemented
This commit is contained in:
@@ -12,9 +12,11 @@ const props = withDefaults(defineProps<{
|
||||
hint?: string
|
||||
}>(), {
|
||||
accept: 'image/*,video/*,audio/*,.mp3,.flac',
|
||||
hint: 'Bilder, Videos & Audio, max. 200 MB',
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const hintText = computed(() => props.hint ?? t('upload.dropzoneHint'))
|
||||
|
||||
const dropzoneRef = ref<HTMLElement>()
|
||||
const inputRef = ref<HTMLInputElement>()
|
||||
const previewUrl = ref<string | null>(null)
|
||||
@@ -25,7 +27,7 @@ const { isOverDropZone } = useDropZone(dropzoneRef, {
|
||||
if (props.disabled) return
|
||||
const file = files?.find(isMediaFile)
|
||||
if (file) select(file)
|
||||
else if (files?.length) toast.error('Nur Bilder, Videos und Audiodateien sind erlaubt')
|
||||
else if (files?.length) toast.error(t('upload.onlyMedia'))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -94,14 +96,14 @@ onUnmounted(() => {
|
||||
@click.stop="select(null)"
|
||||
>
|
||||
<Icon name="ph:x-fill" class="size-4" />
|
||||
Entfernen
|
||||
{{ $t('common.remove') }}
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<Icon name="ph:cloud-arrow-up-fill" class="size-8 text-muted-foreground" />
|
||||
<span>Datei hierher ziehen oder klicken</span>
|
||||
<span class="text-xs text-muted-foreground">{{ hint }}</span>
|
||||
<span>{{ $t('upload.dropzoneText') }}</span>
|
||||
<span class="text-xs text-muted-foreground">{{ hintText }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user