diff --git a/locales/app/en.json b/locales/app/en.json index fe3cc71a9..9e5f5a1a2 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -86,6 +86,7 @@ "search.placeholder": "Search...", "search.result_count_local_mode": "(Local mode)", "search.tooltip.local_search": "This search covers locally available data. Try a Refetch to include the latest data.", + "shortcuts.guide.title": "Shortcuts Guideline", "sidebar.category_remove_dialog.cancel": "Cancel", "sidebar.category_remove_dialog.continue": "Continue", "sidebar.category_remove_dialog.description": "This operation will delete your category, but the feeds it contains will be retained and grouped by website.", @@ -114,6 +115,12 @@ "signin.sign_in_to": "Sign in to", "sync_indicator.offline": "Offline", "sync_indicator.synced": "Synced with server", + "user_button.account": "Account", + "user_button.download_desktop_app": "Download Desktop app", + "user_button.log_out": "Log out", + "user_button.power": "Power", + "user_button.preferences": "Preferences", + "user_button.profile": "Profile", "user_profile.close": "Close", "user_profile.edit": "Edit", "user_profile.loading": "Loading", diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index 94c2bebd3..ed9ee19c8 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -1,4 +1,4 @@ -export const currentSupportedLanguages = ["en", "ja", "zh-CN"] +export const currentSupportedLanguages = ["en", "ja", "zh-CN"].sort() export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], diff --git a/src/renderer/src/components/user-button.tsx b/src/renderer/src/components/user-button.tsx index f506bd57d..20060c614 100644 --- a/src/renderer/src/components/user-button.tsx +++ b/src/renderer/src/components/user-button.tsx @@ -64,6 +64,7 @@ export const ProfileButton: FC = memo((props) => { const signOut = useSignOut() const settingModalPresent = useSettingModal() const presentUserProfile = usePresentUserProfileModal("dialog") + const { t } = useTranslation() if (status !== "authenticated") { return } @@ -71,12 +72,14 @@ export const ProfileButton: FC = memo((props) => { return ( - + - Account + + {t("user_button.account")} +
@@ -93,26 +96,17 @@ export const ProfileButton: FC = memo((props) => { }} icon={} > - Profile + {t("user_button.profile")} - {/* - - - - */} - { - // Here we need to delay one frame, so it's two raf, - // in order to have `point-event: none` recorded by RadixOverlay after modal is invoked in a certain scenario, - // and the page freezes after modal is turned off. nextFrame(() => settingModalPresent("wallet")) }} icon={} > - Power + {t("user_button.power")} { @@ -120,7 +114,7 @@ export const ProfileButton: FC = memo((props) => { }} icon={} > - Preferences + {t("user_button.preferences")} {!window.electron && ( @@ -131,13 +125,13 @@ export const ProfileButton: FC = memo((props) => { }} icon={} > - Download Desktop app + {t("user_button.download_desktop_app")} )} }> - Log out + {t("user_button.log_out")} diff --git a/src/renderer/src/modules/entry-column/lists.tsx b/src/renderer/src/modules/entry-column/lists.tsx index 3c324fa84..2543a08cb 100644 --- a/src/renderer/src/modules/entry-column/lists.tsx +++ b/src/renderer/src/modules/entry-column/lists.tsx @@ -30,7 +30,7 @@ export const EntryEmptyList = forwardRef> {unreadOnly ? ( <> - Zero Unread + {t("entry_list.zero_unread")} ) : (
diff --git a/src/renderer/src/modules/entry-content/header.tsx b/src/renderer/src/modules/entry-content/header.tsx index dd97852c1..696b70e79 100644 --- a/src/renderer/src/modules/entry-content/header.tsx +++ b/src/renderer/src/modules/entry-content/header.tsx @@ -21,6 +21,7 @@ import { useFeedById } from "@renderer/store/feed" import { noop } from "foxact/noop" import { AnimatePresence, m } from "framer-motion" import { memo, useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import { useEntryContentScrollToTop, useEntryTitleMeta } from "./atoms" import { EntryReadHistory } from "./components/EntryReadHistory" @@ -124,6 +125,8 @@ const ElectronAdditionActions = window.electron }) => { const entryReadabilityStatus = useEntryInReadabilityStatus(entry?.entries.id) + const { t } = useTranslation() + const feed = useFeedById(entry?.feedId) const populatedEntry = useMemo(() => { @@ -147,7 +150,7 @@ const ElectronAdditionActions = window.electron const items = [ { key: "tts", - name: "Play TTS", + name: t("entry_content.header.play_tts"), shortcut: shortcuts.entry.tts.key, className: ttsLoading ? "i-mgc-loading-3-cute-re animate-spin" : "i-mgc-voice-cute-re", @@ -176,7 +179,7 @@ const ElectronAdditionActions = window.electron }, }, { - name: "Readability", + name: t("entry_content.header.readability"), className: cn( isInReadability(entryReadabilityStatus) ? `i-mgc-sparkles-2-filled` diff --git a/src/renderer/src/modules/feed-column/item.tsx b/src/renderer/src/modules/feed-column/item.tsx index 74de646d8..6ffce7118 100644 --- a/src/renderer/src/modules/feed-column/item.tsx +++ b/src/renderer/src/modules/feed-column/item.tsx @@ -22,6 +22,7 @@ import { useFeedUnreadStore } from "@renderer/store/unread" import { WEB_URL } from "@shared/constants" import dayjs from "dayjs" import { memo, useCallback } from "react" +import { useTranslation } from "react-i18next" import { usePresentUserProfileModal } from "../profile/hooks" import { UnreadNumber } from "./unread-number" @@ -33,6 +34,7 @@ interface FeedItemProps { showUnreadCount?: boolean } const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedItemProps) => { + const { t } = useTranslation() const subscription = useSubscriptionByFeedId(feedId) const navigate = useNavigateEntry() const handleNavigate: React.MouseEventHandler = useCallback( @@ -131,9 +133,9 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI
- Claimed feed + {t("feed_item.claimed_feed")}
-
This feed is claimed by you.
+
{t("feed_item.claimed_by_you")}
@@ -147,10 +149,10 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI
- Claimed feed + {t("feed_item.claimed_feed")}
- This feed is claimed by + {t("feed_item.claimed_by_owner")} {feed.owner ? ( {feed.owner.name?.slice(0, 2)} ) : ( - its owner. + {t("feed_item.claimed_by_unknown")} )}
@@ -179,7 +181,7 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI
- Error since{" "} + {t("feed_item.error_since")}{" "} {dayjs .duration(dayjs(feed.errorAt).diff(dayjs(), "minute"), "minute") .humanize(true)} @@ -200,7 +202,7 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI - Not publicly visible on your profile page + {t("feed_item.not_publicly_visible")} )} diff --git a/src/renderer/src/modules/modal/shortcuts.tsx b/src/renderer/src/modules/modal/shortcuts.tsx index 6454698e6..c6cb9e30d 100644 --- a/src/renderer/src/modules/modal/shortcuts.tsx +++ b/src/renderer/src/modules/modal/shortcuts.tsx @@ -43,7 +43,7 @@ const ShortcutModalContent = () => { onPointerDownCapture={dragControls.start.bind(dragControls)} className="center w-full border-b p-3 font-medium" > - Shortcuts Guideline + {t("shortcuts.guide.title", { ns: "app" })}