feat(i18n): add translation support for follow actions in discover (#2882)
This commit is contained in:
parent
a43b996c21
commit
6587664ec2
|
|
@ -285,6 +285,7 @@ const SearchCard: FC<{
|
|||
onUnSubscribed?: (item: DiscoverSearchData[number]) => void
|
||||
}> = memo(({ item, onSuccess }) => {
|
||||
const follow = useFollow()
|
||||
const { t } = useTranslation("external")
|
||||
|
||||
return (
|
||||
<Card data-feed-id={item.feed?.id || item.list?.id} className="select-text">
|
||||
|
|
@ -327,6 +328,7 @@ const SearchCard: FC<{
|
|||
<CardFooter>
|
||||
<Button
|
||||
variant={item.isSubscribed ? "outline" : undefined}
|
||||
disabled={item.isSubscribed}
|
||||
onClick={() => {
|
||||
follow({
|
||||
isList: !!item.list?.id,
|
||||
|
|
@ -341,13 +343,13 @@ const SearchCard: FC<{
|
|||
})
|
||||
}}
|
||||
>
|
||||
{item.isSubscribed ? "Followed" : "Follow"}
|
||||
{item.isSubscribed ? t("feed.actions.followed") : t("feed.actions.follow")}
|
||||
</Button>
|
||||
<div className="ml-6 text-zinc-500">
|
||||
<span className="font-medium text-zinc-800 dark:text-zinc-200">
|
||||
{item.subscriptionCount ?? 0}
|
||||
</span>{" "}
|
||||
Followers
|
||||
{t("feed.follower", { count: item.subscriptionCount })}
|
||||
</div>
|
||||
</CardFooter>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"copied_link": "Copied link to clipboard",
|
||||
"feed.actions.follow": "Follow",
|
||||
"feed.actions.followed": "Followed",
|
||||
"feed.copy_feed_url": "Copy Feed URL",
|
||||
"feed.feeds_one": "feed",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"copied_link": "链接已复制到剪贴板",
|
||||
"feed.actions.follow": "订阅",
|
||||
"feed.actions.followed": "已订阅",
|
||||
"feed.copy_feed_url": "复制链接",
|
||||
"feed.feeds_one": "订阅源",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"copied_link": "鏈接已複製到剪貼簿",
|
||||
"feed.actions.follow": "訂閲",
|
||||
"feed.actions.followed": "已訂閲",
|
||||
"feed.copy_feed_url": "複製鏈接",
|
||||
"feed.feeds_one": "訂閲源",
|
||||
|
|
|
|||
Loading…
Reference in New Issue