forked from BRETT/BRETT
i18n implemented
This commit is contained in:
@@ -5,6 +5,7 @@ import type { LiveComment } from '@/composables/useLiveComments'
|
||||
import type { AppNotification } from '@/composables/useNotifications'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const { $i18n } = useNuxtApp()
|
||||
const { user } = useAuth()
|
||||
const { fetchAll, addLive, reset } = useNotifications()
|
||||
const { pushLive } = useLiveComments()
|
||||
@@ -39,11 +40,11 @@ export default defineNuxtPlugin(() => {
|
||||
else if (message.type === 'notification') {
|
||||
const n = message.notification as AppNotification
|
||||
addLive(n, typeof message.unreadCount === 'number' ? message.unreadCount : undefined)
|
||||
toast(n.isMention ? `${n.actorName} hat dich erwähnt` : `${n.actorName} hat in einem abonnierten Thread kommentiert`, {
|
||||
toast($i18n.t(n.isMention ? 'notifications.toastMentioned' : 'notifications.toastCommented', { name: n.actorName }), {
|
||||
id: `notification-${n.uploadId}`,
|
||||
description: n.content?.slice(0, 80) || undefined,
|
||||
action: {
|
||||
label: 'Ansehen',
|
||||
label: $i18n.t('notifications.view'),
|
||||
onClick: () => navigateTo(`/thread/${n.uploadId}#comment-${n.commentId}`),
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user