forked from BRETT/BRETT
i18n implemented
This commit is contained in:
@@ -6,9 +6,10 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip
|
||||
const props = defineProps<{ uploadId: string, enabled: boolean }>()
|
||||
const emit = defineEmits<{ change: [uploadId: string, enabled: boolean] }>()
|
||||
const busy = shallowRef(false)
|
||||
const { t } = useI18n()
|
||||
const label = computed(() => props.enabled
|
||||
? 'Benachrichtigungen für diesen Thread deaktivieren'
|
||||
: 'Benachrichtigungen für diesen Thread aktivieren')
|
||||
? t('thread.subscribeOff')
|
||||
: t('thread.subscribeOn'))
|
||||
|
||||
async function toggle() {
|
||||
if (busy.value) return
|
||||
@@ -20,10 +21,10 @@ async function toggle() {
|
||||
body: { enabled: !props.enabled },
|
||||
})
|
||||
emit('change', uploadId, result.enabled)
|
||||
toast.success(result.enabled ? 'Thread-Benachrichtigungen aktiviert' : 'Thread-Benachrichtigungen deaktiviert')
|
||||
toast.success(result.enabled ? t('thread.subOn') : t('thread.subOff'))
|
||||
}
|
||||
catch {
|
||||
toast.error('Abonnement konnte nicht geändert werden')
|
||||
toast.error(t('thread.subFailed'))
|
||||
}
|
||||
finally {
|
||||
busy.value = false
|
||||
|
||||
Reference in New Issue
Block a user