Skip to content

Commit

Permalink
feat(i18n): add translation support for follow actions in discover (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kovsu authored Feb 26, 2025
1 parent a43b996 commit 6587664
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/renderer/src/modules/discover/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -327,6 +328,7 @@ const SearchCard: FC<{
<CardFooter>
<Button
variant={item.isSubscribed ? "outline" : undefined}
disabled={item.isSubscribed}
onClick={() => {
follow({
isList: !!item.list?.id,
Expand All @@ -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>
</>
Expand Down
1 change: 1 addition & 0 deletions locales/external/en.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions locales/external/zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"copied_link": "链接已复制到剪贴板",
"feed.actions.follow": "订阅",
"feed.actions.followed": "已订阅",
"feed.copy_feed_url": "复制链接",
"feed.feeds_one": "订阅源",
Expand Down
1 change: 1 addition & 0 deletions locales/external/zh-HK.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"copied_link": "鏈接已複製到剪貼簿",
"feed.actions.follow": "訂閲",
"feed.actions.followed": "已訂閲",
"feed.copy_feed_url": "複製鏈接",
"feed.feeds_one": "訂閲源",
Expand Down

0 comments on commit 6587664

Please sign in to comment.