Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(i18n): add translation support for follow actions in discover #2882

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading