i18n: improve

zio/stable
Anthony Fu 2022-11-30 10:16:15 +08:00
parent ba93e6d235
commit 9c83e8bbb6
3 changed files with 10 additions and 8 deletions

View File

@ -21,16 +21,14 @@ async function toggleFollow() {
} }
} }
const { t } = useI18n()
useCommand({ useCommand({
scope: 'Actions', scope: 'Actions',
order: -2, order: -2,
visible: () => command && enable, visible: () => command && enable,
name: () => `${relationship?.following ? t('account.unfollow') : t('account.follow')} ${getShortHandle(account)}`,
name: () => `${relationship?.following ? 'Unfollow' : 'Follow'} ${getShortHandle(account)}`,
icon: 'i-ri:star-line', icon: 'i-ri:star-line',
onActivate: () => toggleFollow(), onActivate: () => toggleFollow(),
}) })
</script> </script>
@ -44,7 +42,7 @@ useCommand({
rounded-full flex="~ gap2 center" font-500 w-30 h-fit py1 :class="relationship?.following ? 'text-base border-text-base' : 'text-inverted bg-primary border-primary'" :hover="relationship?.following ? 'border-red text-red' : 'bg-base border-primary text-primary'" @click="toggleFollow" rounded-full flex="~ gap2 center" font-500 w-30 h-fit py1 :class="relationship?.following ? 'text-base border-text-base' : 'text-inverted bg-primary border-primary'" :hover="relationship?.following ? 'border-red text-red' : 'bg-base border-primary text-primary'" @click="toggleFollow"
> >
<template v-if="relationship?.following"> <template v-if="relationship?.following">
<span group-hover="hidden">{{ relationship?.followedBy ? 'Mutuals' : 'Following' }}</span> <span group-hover="hidden">{{ relationship?.followedBy ? $t('account.mutuals') : $t('account.following') }}</span>
<span hidden group-hover="inline">{{ $t('account.unfollow') }}</span> <span hidden group-hover="inline">{{ $t('account.unfollow') }}</span>
</template> </template>
<template v-else-if="relationship?.requested"> <template v-else-if="relationship?.requested">

View File

@ -7,9 +7,11 @@
"follow_back": "Follow back", "follow_back": "Follow back",
"follow_requested": "Requested", "follow_requested": "Requested",
"followers_count": "{0} Followers", "followers_count": "{0} Followers",
"following": "Following",
"following_count": "{0} Following", "following_count": "{0} Following",
"follows_you": "Follows you", "follows_you": "Follows you",
"muted_users": "Muted users", "muted_users": "Muted users",
"mutuals": "Mutuals",
"pinned": "Pinned", "pinned": "Pinned",
"posts_count": "{0} Posts", "posts_count": "{0} Posts",
"unfollow": "Unfollow" "unfollow": "Unfollow"
@ -105,9 +107,9 @@
"uploading": "Uploading..." "uploading": "Uploading..."
}, },
"status": { "status": {
"reblogged": "{0} reblogged",
"spoiler_show_less": "Show less", "spoiler_show_less": "Show less",
"spoiler_show_more": "Show more", "spoiler_show_more": "Show more"
"reblogged": "{0} reblogged"
}, },
"tab": { "tab": {
"media": "Media", "media": "Media",

View File

@ -7,9 +7,11 @@
"follow_back": "回关", "follow_back": "回关",
"follow_requested": "已申请关注", "follow_requested": "已申请关注",
"followers_count": "被 {0} 人关注", "followers_count": "被 {0} 人关注",
"following": "关注中",
"following_count": "正在关注 {0} 人", "following_count": "正在关注 {0} 人",
"follows_you": "已关注你", "follows_you": "已关注你",
"muted_users": "已屏蔽的用户", "muted_users": "已屏蔽的用户",
"mutuals": "互相关注",
"pinned": "置顶的帖文", "pinned": "置顶的帖文",
"posts_count": "{0} 条帖文", "posts_count": "{0} 条帖文",
"unfollow": "取消关注" "unfollow": "取消关注"