fix(i18n): hint for settings on notifications page (#893)

Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
Joaquín Sánchez 2023-01-09 10:31:00 +01:00 committed by GitHub
parent e336ac928b
commit 52f81a34c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 5 deletions

View file

@ -1,4 +1,6 @@
<script setup lang="ts">
import { useMediaQuery } from '@vueuse/core'
defineProps<{
closeableHeader?: boolean
busy?: boolean
@ -11,6 +13,8 @@ defineSlots<{
error: {}
}>()
const xl = useMediaQuery('(min-width: 1280px)')
const isLegacyAccount = computed(() => !currentUser.value?.vapidKey)
</script>
@ -38,8 +42,19 @@ const isLegacyAccount = computed(() => !currentUser.value?.vapidKey)
<span aria-hidden="true" i-ri:close-line />
</button>
</header>
<p>
{{ $t(`settings.notifications.push_notifications.warning.enable_description${closeableHeader ? '' : '_settings'}`) }}
<template v-if="closeableHeader">
<p xl:hidden>
{{ $t('settings.notifications.push_notifications.warning.enable_description') }}
</p>
<p xl:hidden>
{{ $t('settings.notifications.push_notifications.warning.enable_description_mobile') }}
</p>
<p :class="xl ? null : 'hidden'">
{{ $t('settings.notifications.push_notifications.warning.enable_description_desktop') }}
</p>
</template>
<p v-else>
{{ $t('settings.notifications.push_notifications.warning.enable_description_settings') }}
</p>
<p v-if="isLegacyAccount">
{{ $t('settings.notifications.push_notifications.warning.re_auth') }}
@ -52,7 +67,7 @@ const isLegacyAccount = computed(() => !currentUser.value?.vapidKey)
@click="$emit('subscribe')"
>
<span aria-hidden="true" :class="busy && animate ? 'i-ri:loader-2-fill animate-spin' : 'i-ri:check-line'" />
{{ $t('settings.notifications.push_notifications.warning.enable_desktop') }}
<span>{{ $t('settings.notifications.push_notifications.warning.enable_desktop') }}</span>
</button>
<slot name="error" />
</div>