feat: more i18n and sort keys

This commit is contained in:
Anthony Fu 2022-11-29 14:57:32 +08:00
parent a397b170ab
commit 793ae3cb4e
9 changed files with 127 additions and 93 deletions

View file

@ -30,17 +30,17 @@ async function toggleFollow() {
<div rounded w-28 p2 :group-hover="relationship?.following ? 'bg-red/75' : 'bg-orange/40'" :class="!relationship?.following ? relationship?.followedBy ? 'bg-orange/20' : 'bg-white/10' : relationship?.followedBy ? ' bg-orange/70' : 'bg-orange/50'">
<template v-if="relationship?.following">
<span group-hover="hidden">{{ relationship?.followedBy ? 'Mutuals' : 'Following' }}</span>
<span hidden group-hover="inline">Unfollow</span>
<span hidden group-hover="inline">{{ $t('account.unfollow') }}</span>
</template>
<template v-else-if="relationship?.requested">
<span>Requested</span>
<span>{{ $t('account.follow_requested') }}</span>
</template>
<template v-else-if="relationship?.followedBy">
<span group-hover="hidden">Follows you</span>
<span hidden group-hover="inline">Follow back</span>
<span group-hover="hidden">{{ $t('account.follows_you') }}</span>
<span hidden group-hover="inline">{{ $t('account.follow_back') }}</span>
</template>
<template v-else>
<span>Follow</span>
<span>{{ $t('account.follow') }}</span>
</template>
</div>
</button>

View file

@ -45,31 +45,31 @@ const toggleBlockDomain = async () => {
<template #popper>
<NuxtLink :to="account.url" target="_blank">
<CommonDropdownItem icon="i-ri:arrow-right-up-line">
Open in original site
{{ $t('menu.open_in_original_site') }}
</CommonDropdownItem>
</NuxtLink>
<template v-if="currentUser">
<template v-if="!isSelf">
<CommonDropdownItem icon="i-ri:at-line" @click="mentionUser(account)">
Mention @{{ account.acct }}
{{ $t('menu.mention_account', [account.acct]) }}
</CommonDropdownItem>
<CommonDropdownItem icon="i-ri:message-3-line" @click="directMessageUser(account)">
Direct message @{{ account.acct }}
{{ $t('menu.direct_message_account', [account.acct]) }}
</CommonDropdownItem>
<CommonDropdownItem v-if="!relationship?.muting" icon="i-ri:volume-up-fill" @click="toggleMute">
Mute @{{ account.acct }}
{{ $t('menu.mute_account', [account.acct]) }}
</CommonDropdownItem>
<CommonDropdownItem v-else icon="i-ri:volume-mute-line" @click="toggleMute">
Unmute @{{ account.acct }}
{{ $t('menu.unmute_account', [account.acct]) }}
</CommonDropdownItem>
<CommonDropdownItem v-if="!relationship?.blocking" icon="i-ri:forbid-2-line" @click="toggleBlockUser">
Block @{{ account.acct }}
{{ $t('menu.block_account', [account.acct]) }}
</CommonDropdownItem>
<CommonDropdownItem v-else icon="i-ri:checkbox-circle-line" @click="toggleBlockUser">
Unblock @{{ account.acct }}
{{ $t('menu.unblock_account', [account.acct]) }}
</CommonDropdownItem>
<template v-if="getServerName(account) !== currentServer">
@ -78,10 +78,10 @@ const toggleBlockDomain = async () => {
icon="i-ri:shut-down-line"
@click="toggleBlockDomain"
>
Block domain {{ getServerName(account) }}
{{ $t('menu.block_domain', [getServerName(account)]) }}
</CommonDropdownItem>
<CommonDropdownItem v-else icon="i-ri:restart-line" @click="toggleBlockDomain">
Unblock domain {{ getServerName(account) }}
{{ $t('menu.unblock_domain', [getServerName(account)]) }}
</CommonDropdownItem>
</template>
</template>

View file

@ -10,21 +10,21 @@ defineProps<{
<div flex gap-5>
<NuxtLink :to="getAccountPath(account)" text-secondary exact-active-class="text-primary">
<template #default="{ isExactActive }">
<i18n-t keypath="account.posts">
<i18n-t keypath="account.posts_count">
<span font-bold :class="isExactActive ? 'text-primary' : 'text-base'">{{ formattedNumber(account.statusesCount) }}</span>
</i18n-t>
</template>
</NuxtLink>
<NuxtLink :to="`${getAccountPath(account)}/following`" text-secondary exact-active-class="text-primary">
<template #default="{ isExactActive }">
<i18n-t keypath="account.following">
<i18n-t keypath="account.following_count">
<span font-bold :class="isExactActive ? 'text-primary' : 'text-base'">{{ humanReadableNumber(account.followingCount) }}</span>
</i18n-t>
</template>
</NuxtLink>
<NuxtLink :to="`${getAccountPath(account)}/followers`" text-secondary exact-active-class="text-primary">
<template #default="{ isExactActive }">
<i18n-t keypath="account.followers">
<i18n-t keypath="account.following_count">
<span font-bold :class="isExactActive ? 'text-primary' : 'text-base'">{{ humanReadableNumber(account.followersCount) }}</span>
</i18n-t>
</template>