diff --git a/locales/app/en.json b/locales/app/en.json index 73fbffb0d..6e04a847c 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -17,16 +17,25 @@ "discover.select_placeholder": "Select", "early_access": "Early Access", "entry_actions.copy_link": "Copy link", + "entry_actions.failed_to_save_to_eagle": "Failed to save to Eagle.", + "entry_actions.failed_to_save_to_instapaper": "Failed to save to Instapaper.", + "entry_actions.failed_to_save_to_readwise": "Failed to save to Readwise.", + "entry_actions.link_copied": "Link copied to clipboard.", "entry_actions.mark_as_read": "Mark as read", "entry_actions.mark_as_unread": "Mark as unread", "entry_actions.open_in_browser": "Open in browser", "entry_actions.save_media_to_eagle": "Save media to Eagle", "entry_actions.save_to_instapaper": "Save to Instapaper", "entry_actions.save_to_readwise": "Save to Readwise", + "entry_actions.saved_to_eagle": "Saved to Eagle.", + "entry_actions.saved_to_instapaper": "Saved to Instapaper.", + "entry_actions.saved_to_readwise": "Saved to Readwise.", "entry_actions.share": "Share", "entry_actions.star": "Star", + "entry_actions.starred": "Starred.", "entry_actions.tip": "Tip", "entry_actions.unstar": "Unstar", + "entry_actions.unstarred": "Unstarred.", "entry_column.refreshing": "Refreshing new entries...", "entry_content.ai_summary": "AI summary", "entry_content.fetching_content": "Fetching original content and processing...", @@ -48,6 +57,21 @@ "entry_list_header.switch_to_grid": "Switch to Grid", "entry_list_header.switch_to_masonry": "Switch to Masonry", "entry_list_header.unread": "unread", + "feed_claim_modal.choose_verification_method": "There are three ways to choose from, you can choose one of them to verify.", + "feed_claim_modal.claim_button": "Claim", + "feed_claim_modal.content_instructions": "Copy the content below and post it to your latest RSS feed.", + "feed_claim_modal.description_current": "Current description:", + "feed_claim_modal.description_instructions": "Copy the following content and paste it into the field of your RSS feed.", + "feed_claim_modal.failed_to_load": "Failed to load claim message", + "feed_claim_modal.rss_format_choice": "RSS generators generally have two formats to choose from. Please copy the XML and JSON formats below as needed.", + "feed_claim_modal.rss_instructions": "Copy the code below and paste it into your RSS generator.", + "feed_claim_modal.rss_json_format": "JSON Format", + "feed_claim_modal.rss_xml_format": "XML Format", + "feed_claim_modal.rsshub_notice": "This feed is provided by RSSHub with a 1 hour cache time. Please allow up to 1 hour for changes to appear after publishing content.", + "feed_claim_modal.tab_content": "Content", + "feed_claim_modal.tab_description": "Description", + "feed_claim_modal.tab_rss": "RSS Tag", + "feed_claim_modal.verify_ownership": "To claim this feed as your own, you need to verify ownership.", "feed_form.add_follow": "Add follow", "feed_form.category": "Category", "feed_form.category_description": "By default, your follows will be grouped by website.", @@ -124,6 +148,17 @@ "signin.sign_in_to": "Sign in to", "sync_indicator.offline": "Offline", "sync_indicator.synced": "Synced with server", + "tip_modal.amount": "Amount", + "tip_modal.claim_feed": "Claim this feed", + "tip_modal.create_wallet": "Create For Free", + "tip_modal.feed_owner": "Feed Owner", + "tip_modal.low_balance": "Your balance is not enough to cover this tip. Please adjust the amount.", + "tip_modal.no_wallet": "You don't have a wallet yet. Please create a wallet to tip.", + "tip_modal.tip_amount_sent": "has been sent to the author.", + "tip_modal.tip_now": "Tip Now", + "tip_modal.tip_sent": "Tip sent successfully! Thank you for your support.", + "tip_modal.tip_support": "⭐ Tip to show your support!", + "tip_modal.unclaimed_feed": "No one has claimed this feed yet. The received Power will be securely held in the blockchain contract until it is claimed.", "user_button.account": "Account", "user_button.download_desktop_app": "Download Desktop app", "user_button.log_out": "Log out", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index ad4d70343..c18b2377c 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -179,11 +179,11 @@ "wallet.transactions.to": "接收自", "wallet.transactions.tx": "交易", "wallet.transactions.type": "类型", - "wallet.transactions.types.burn": "销毁", - "wallet.transactions.types.mint": "铸造", - "wallet.transactions.types.purchase": "购买", - "wallet.transactions.types.tip": "打赏", - "wallet.transactions.types.withdraw": "提取", + "wallet.transactions.types.burn": "burn", + "wallet.transactions.types.mint": "mint", + "wallet.transactions.types.purchase": "purchase", + "wallet.transactions.types.tip": "tip", + "wallet.transactions.types.withdraw": "withdraw", "wallet.transactions.you": "您", "wallet.withdraw.addressLabel": "您的以太坊地址", "wallet.withdraw.amountLabel": "数量", diff --git a/src/renderer/src/hooks/biz/useEntryActions.tsx b/src/renderer/src/hooks/biz/useEntryActions.tsx index 5857954c6..f6f8485d4 100644 --- a/src/renderer/src/hooks/biz/useEntryActions.tsx +++ b/src/renderer/src/hooks/biz/useEntryActions.tsx @@ -63,27 +63,31 @@ export const useEntryReadabilityToggle = ({ id, url }: { id: string; url: string }) } }, [id, url]) -export const useCollect = (entry: Nullable) => - useMutation({ +export const useCollect = (entry: Nullable) => { + const { t } = useTranslation() + return useMutation({ mutationFn: async () => entry && entryActions.markStar(entry.entries.id, true), onSuccess: () => { - toast.success("Starred.", { + toast.success(t("entry_actions.starred"), { duration: 1000, }) }, }) +} -export const useUnCollect = (entry: Nullable) => - useMutation({ +export const useUnCollect = (entry: Nullable) => { + const { t } = useTranslation() + return useMutation({ mutationFn: async () => entry && entryActions.markStar(entry.entries.id, false), onSuccess: () => { - toast.success("Unstarred.", { + toast.success(t("entry_actions.unstarred"), { duration: 1000, }) }, }) +} export const useRead = () => useMutation({ @@ -179,11 +183,11 @@ export const useEntryActions = ({ mediaUrls: populatedEntry.entries.media.map((m) => m.url), }) if (response?.status === "success") { - toast.success("Saved to Eagle.", { + toast.success(t("entry_actions.saved_to_eagle"), { duration: 3000, }) } else { - toast.error("Failed to save to Eagle.", { + toast.error(t("entry_actions.failed_to_save_to_eagle"), { duration: 3000, }) } @@ -214,7 +218,7 @@ export const useEntryActions = ({ }) toast.success( <> - Saved to Readwise,{" "} + {t("entry_actions.saved_to_readwise")},{" "} view @@ -224,7 +228,7 @@ export const useEntryActions = ({ }, ) } catch { - toast.error("Failed to save to Readwise.", { + toast.error(t("entry_actions.failed_to_save_to_readwise"), { duration: 3000, }) } @@ -254,7 +258,7 @@ export const useEntryActions = ({ }) toast.success( <> - Saved to Instapaper,{" "} + {t("entry_actions.saved_to_instapaper")},{" "} { if (!populatedEntry.entries.url) return navigator.clipboard.writeText(populatedEntry.entries.url) - toast("Link copied to clipboard.", { + toast(t("entry_actions.link_copied"), { duration: 1000, }) }, @@ -375,15 +379,21 @@ export const useEntryActions = ({ }, [ populatedEntry, view, + t, + enableEagle, checkEagle.isLoading, checkEagle.data, + enableReadwise, + readwiseToken, + enableInstapaper, + instapaperPassword, + instapaperUsername, + feed?.ownerUserId, openTipModal, collect, uncollect, read, unread, - feed?.ownerUserId, - t, ]) return { diff --git a/src/renderer/src/modules/claim/feed-claim-modal.tsx b/src/renderer/src/modules/claim/feed-claim-modal.tsx index 00f00371d..0d15f6275 100644 --- a/src/renderer/src/modules/claim/feed-claim-modal.tsx +++ b/src/renderer/src/modules/claim/feed-claim-modal.tsx @@ -13,10 +13,12 @@ import { useClaimFeedMutation } from "@renderer/queries/feed" import { useFeedById } from "@renderer/store/feed" import type { FC } from "react" import { useEffect } from "react" +import { Trans, useTranslation } from "react-i18next" export const FeedClaimModalContent: FC<{ feedId: string }> = ({ feedId }) => { + const { t } = useTranslation() const feed = useFeedById(feedId) const { data: claimMessage, @@ -46,7 +48,7 @@ export const FeedClaimModalContent: FC<{ } if (error) { - return
Failed to load claim message
+ return
{t("feed_claim_modal.failed_to_load")}
} return ( @@ -56,52 +58,46 @@ export const FeedClaimModalContent: FC<{ -

To claim this feed as your own, you need to verify ownership.

-

There are three ways to choose from, you can choose one of them to verify.

+

{t("feed_claim_modal.verify_ownership")}

+

{t("feed_claim_modal.choose_verification_method")}

- Content - Description - RSS Tag + {t("feed_claim_modal.tab_content")} + {t("feed_claim_modal.tab_description")} + {t("feed_claim_modal.tab_rss")} -

Copy the content below and post it to your latest RSS feed.

+

{t("feed_claim_modal.content_instructions")}

{feed.url.startsWith("rsshub://") && (

- This feed is provided by RSSHub with a 1 hour cache time. Please allow up to 1 hour - for changes to appear after publishing content. + {t("feed_claim_modal.rsshub_notice")}

)} - {claimMessage?.data.content || ""}

- Current description: + {t("feed_claim_modal.description_current")} {feed.description}

-

- Copy the following content and paste it into the{" "} - {``} field of your RSS feed. -

+ {""}
}} + /> {feed.url.startsWith("rsshub://") && (

- This feed is provided by RSSHub with a 1 hour cache time. Please allow up to 1 hour - for changes to appear after modifying description. + {t("feed_claim_modal.rsshub_notice")}

)} {claimMessage?.data.description || ""}
-

Copy the code below and paste it into your RSS generator.

+

{t("feed_claim_modal.rss_instructions")}

+

{t("feed_claim_modal.rss_format_choice")}

- RSS generators generally have two formats to choose from. Please copy the XML and - JSON formats below as needed. -

-

- XML Format + {t("feed_claim_modal.rss_xml_format")}

- JSON Format + {t("feed_claim_modal.rss_json_format")}

{isSuccess && } - Claim + {t("feed_claim_modal.claim_button")}
diff --git a/src/renderer/src/modules/settings/section.tsx b/src/renderer/src/modules/settings/section.tsx index db374179d..3068f5882 100644 --- a/src/renderer/src/modules/settings/section.tsx +++ b/src/renderer/src/modules/settings/section.tsx @@ -15,7 +15,7 @@ export const SettingSectionTitle: FC<{ }> = ({ title, margin }) => (
diff --git a/src/renderer/src/modules/settings/tabs/wallet/index.tsx b/src/renderer/src/modules/settings/tabs/wallet/index.tsx index 5807c313e..188e3ffda 100644 --- a/src/renderer/src/modules/settings/tabs/wallet/index.tsx +++ b/src/renderer/src/modules/settings/tabs/wallet/index.tsx @@ -1,10 +1,9 @@ - import { SettingsTitle } from "../../title" import { MyWalletSection } from "./my-wallet-section" import { TransactionsSection } from "./transaction-section" export const SettingWallet = () => ( -
+
diff --git a/src/renderer/src/modules/settings/tabs/wallet/transaction-section/index.tsx b/src/renderer/src/modules/settings/tabs/wallet/transaction-section/index.tsx index 1d2f5847c..b8e16ef62 100644 --- a/src/renderer/src/modules/settings/tabs/wallet/transaction-section/index.tsx +++ b/src/renderer/src/modules/settings/tabs/wallet/transaction-section/index.tsx @@ -45,10 +45,10 @@ export const TransactionsSection = () => { } return ( -
+
- + @@ -128,7 +128,7 @@ const TypeRenderer = ({ const { t } = useTranslation("settings") return (
- {formatted} {withSuffix && Power} + {formatted}{" "} + {withSuffix && ( + + Power + + )}
) diff --git a/src/renderer/src/modules/wallet/tip-modal.tsx b/src/renderer/src/modules/wallet/tip-modal.tsx index d20fcf5f6..bf1fc816a 100644 --- a/src/renderer/src/modules/wallet/tip-modal.tsx +++ b/src/renderer/src/modules/wallet/tip-modal.tsx @@ -6,6 +6,7 @@ import { useCurrentModal } from "@renderer/components/ui/modal" import { RadioGroup } from "@renderer/components/ui/radio-group" import { RadioCard } from "@renderer/components/ui/radio-group/RadioCard" import { UserAvatar } from "@renderer/components/user-button" +import { useI18n } from "@renderer/hooks/common" import { nextFrame } from "@renderer/lib/dom" import { useWallet, useWalletTipMutation } from "@renderer/queries/wallet" import { from } from "dnum" @@ -47,6 +48,7 @@ const TipModalContent_: FC<{ feedId: string entryId: string }> = ({ userId, feedId, entryId }) => { + const t = useI18n() const myWallet = useMyWallet() const myWalletData = myWallet.data?.[0] @@ -77,38 +79,30 @@ const TipModalContent_: FC<{ if (!myWalletData) { return (
-

- You don't have a wallet yet. Please create a wallet to tip. -

+

{t("tip_modal.no_wallet")}

) } - // if (transactionsQuery.error) { - // return
Failed to load transactions history.
- // } - if (tipMutation.isSuccess) { return (
-

- Tip sent successfully! Thank you for your support. -

+

{t("tip_modal.tip_sent")}

{amountBigInt} {" "} - has been sent to the author. + {t("tip_modal.tip_amount_sent")}

@@ -119,31 +113,30 @@ const TipModalContent_: FC<{
{userId ? ( <> -

Feed Owner

+

{t("tip_modal.feed_owner")}

) : ( <>

- No one has claimed this feed yet. The received Power will be securely held in the - blockchain contract until it is claimed. + {t("tip_modal.unclaimed_feed")}

)} -

⭐ Tip to show your support!

+

{t("tip_modal.tip_support")}

- Amount + {t("tip_modal.amount")}
setAmount(Number(value))}> @@ -158,7 +151,7 @@ const TipModalContent_: FC<{ <>
- Your balance is not enough to cover this tip. Please adjust the amount. + {t("tip_modal.low_balance")}
)} @@ -178,7 +171,7 @@ const TipModalContent_: FC<{ variant={tipMutation.isSuccess ? "outline" : "primary"} > {tipMutation.isSuccess && } - Tip Now + {t("tip_modal.tip_now")}