i18n: improve translations
This commit is contained in:
parent
acdd33ef7d
commit
ccffe9daa8
15 changed files with 231 additions and 143 deletions
|
@ -7,12 +7,25 @@ definePageMeta({
|
|||
|
||||
const { t } = useI18n()
|
||||
|
||||
const tabNames = ['All', 'Mentions'] as const
|
||||
const tab = $(useLocalStorage<typeof tabNames[number]>(STORAGE_KEY_NOTIFY_TAB, 'All'))
|
||||
const paginatorAll = useMasto().notifications.getIterator()
|
||||
const paginatorMention = useMasto().notifications.getIterator({ types: ['mention'] })
|
||||
|
||||
const paginator = $computed(() => {
|
||||
return useMasto().notifications.getIterator(tab === 'All' ? undefined : { types: ['mention'] })
|
||||
})
|
||||
const tabs = $computed(() => [
|
||||
{
|
||||
name: 'all',
|
||||
display: t('tab.notifications_all'),
|
||||
paginator: paginatorAll,
|
||||
},
|
||||
{
|
||||
name: 'mention',
|
||||
display: t('tab.notifications_mention'),
|
||||
paginator: paginatorMention,
|
||||
},
|
||||
] as const)
|
||||
|
||||
// Don't use local storage because it is better to default to Posts every time you visit a user's profile.
|
||||
const tab = $ref(tabs[0].name)
|
||||
const paginator = $computed(() => tabs.find(t => t.name === tab)!.paginator)
|
||||
|
||||
useHeadFixed({
|
||||
title: () => t('nav_side.notifications'),
|
||||
|
@ -29,7 +42,7 @@ useHeadFixed({
|
|||
</template>
|
||||
|
||||
<template #header>
|
||||
<CommonTabs v-model="tab" :options="tabNames" />
|
||||
<CommonTabs v-model="tab" :options="tabs" />
|
||||
</template>
|
||||
<slot>
|
||||
<NotificationPaginator :key="tab" :paginator="paginator" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue