From 7c3aab6f042a710aaa99d8fb7a774fce89af2b08 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 14:16:23 +0800 Subject: [PATCH 01/66] fix: fill relative url in entry title link, fix #372 Signed-off-by: Innei --- src/renderer/src/lib/link-parser.ts | 3 ++- .../src/modules/entry-content/index.tsx | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/lib/link-parser.ts b/src/renderer/src/lib/link-parser.ts index 0e871d87e..431872f0e 100644 --- a/src/renderer/src/lib/link-parser.ts +++ b/src/renderer/src/lib/link-parser.ts @@ -6,7 +6,7 @@ export type LinkParserOptions = { icon: string } -const parseSafeUrl = (url: string) => { +export const parseSafeUrl = (url: string) => { try { return new URL(url) } catch { @@ -27,6 +27,7 @@ const defineLinkParser = (options: LinkParserOptions) => { define.icon = options.icon return define } + export const isYoutubeUrl = defineLinkParser({ name: "youtube", validator: (url) => url.hostname.includes("youtube.com"), diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index e7d5c1a8e..65ed4dd10 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -48,6 +48,14 @@ import { EntryHeader } from "./header" import { EntryContentLoading } from "./loading" import { EntryContentProvider } from "./provider" +const safeUrl = (url: string, baseUrl: string) => { + try { + return new URL(url, baseUrl).href + } catch { + return url + } +} + export const EntryContent = ({ entryId }: { entryId: ActiveEntryId }) => { const title = useFeedHeaderTitle() const { feedId, view } = useRouteParms() @@ -150,6 +158,17 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl : undefined, [readerFontFamily], ) + + const populatedFullHref = useMemo(() => { + const href = entry?.entries.url + if (!href) return "#" + + if (href.startsWith("http")) return href + const feedSiteUrl = feed?.siteUrl + if (href.startsWith("/") && feedSiteUrl) return safeUrl(href, feedSiteUrl) + return href + }, [entry?.entries.url, feed?.siteUrl]) + if (!entry) return null const content = entry?.entries.content ?? data?.entries.content @@ -184,7 +203,7 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl className="relative m-auto min-w-0 max-w-[550px] @3xl:max-w-[70ch]" > Date: Fri, 13 Sep 2024 14:33:54 +0800 Subject: [PATCH 02/66] chore: add web app link on readme Signed-off-by: Innei --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 03df839b0..c7a919d35 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ You can get an invitation code in the following ways: If you have access, you are welcome to use the following methods to download and install it: +- Visit our online webapp at [app.follow.is](https://app.follow.is) - You can get the installation packages for each platform from the [Releases page](https://github.com/RSSNext/Follow/releases). - If you are using Arch linux, you can install package [follow-appimage](https://aur.archlinux.org/packages/follow-appimage) that maintained by [timochan](https://github.com/ttimochan). From 74b960c3cf58648d2823c77a45d4043aaf0e3acf Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Fri, 13 Sep 2024 15:25:37 +0800 Subject: [PATCH 03/66] chore: fix type --- src/renderer/src/components/ui/platform-icon/utils.tsx | 2 +- src/renderer/src/lib/link-parser.ts | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/ui/platform-icon/utils.tsx b/src/renderer/src/components/ui/platform-icon/utils.tsx index 1e8175634..8277000d4 100644 --- a/src/renderer/src/components/ui/platform-icon/utils.tsx +++ b/src/renderer/src/components/ui/platform-icon/utils.tsx @@ -19,7 +19,7 @@ export const getSupportedPlatformIconName = (url: string) => { ) } -const parseSafeUrl = (url: string) => { +export const parseSafeUrl = (url: string) => { try { return new URL(url) } catch { diff --git a/src/renderer/src/lib/link-parser.ts b/src/renderer/src/lib/link-parser.ts index 431872f0e..7b613edbd 100644 --- a/src/renderer/src/lib/link-parser.ts +++ b/src/renderer/src/lib/link-parser.ts @@ -1,3 +1,5 @@ +import { parseSafeUrl } from "@renderer/components/ui/platform-icon/utils" + const GITHUB_HOST = "github.com" export type LinkParserOptions = { @@ -6,13 +8,6 @@ export type LinkParserOptions = { icon: string } -export const parseSafeUrl = (url: string) => { - try { - return new URL(url) - } catch { - return null - } -} const defineLinkParser = (options: LinkParserOptions) => { const define = (url: URL | string) => { const safeUrl = typeof url === "string" ? parseSafeUrl(url) : url From 140d01a521a472b56f420585f57b577727dee996 Mon Sep 17 00:00:00 2001 From: Randy Date: Fri, 13 Sep 2024 18:32:21 +0800 Subject: [PATCH 04/66] feat(i18n): Simplified Chinese (partial) (#353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * i18n: apperance setting page * invitation, actions, profile setting translation * translation: words translation * translation: sidebar * translation: move translation * remove namespace * translation: sidebar context menu * translation: apperance setting * translation: general setting * translaton: actions setting * translation: shortcusts settings * translation: invitations setting * translation: about setting * translation: article list * translation: entry content view * chore: disable `noImplicitReturns` Signed-off-by: Innei * fix: fill en source Signed-off-by: Innei * chore: lint locales key * feat: hmr fix Signed-off-by: Innei * use namespace * translation: make i18n key flat * translation: update namespace type defination * translation: shortcut namespace * translation: feed form * translation: update words.which * translation: ai daily tooltip * translation: date i18n * translation: fix i18n key typo * translation: update mark all as read button * translation: fix about page translation * translation: update apperance namespace * translation: fix settings namespace * translation: fix settings namespace key * fix lint error * fix: shortcuts guideline i18n Signed-off-by: Innei * feat:setting zh-cn Signed-off-by: Innei * translate Signed-off-by: Innei * feat: discover Signed-off-by: Innei --------- Signed-off-by: Innei Co-authored-by: Innei Co-authored-by: Stephen Zhou --- .vscode/settings.json | 12 +- configs/vite.render.config.ts | 5 + eslint.config.mjs | 18 ++ locales/app/en.json | 226 ++++++++------- locales/app/zh-CN.json | 119 ++++++++ locales/app/zh_CN.json | 75 ----- locales/common/en.json | 19 +- locales/common/zh-CN.json | 20 ++ locales/common/zh_CN.json | 8 - locales/external/en.json | 6 +- locales/lang/en.json | 8 +- locales/lang/zh-CN.json | 5 + locales/lang/zh_CN.json | 3 - locales/settings/en.json | 194 +++++++++++++ locales/settings/zh-CN.json | 196 +++++++++++++ locales/shortcuts/en.json | 24 ++ locales/shortcuts/zh-CN.json | 24 ++ src/renderer/src/@types/constants.ts | 5 +- src/renderer/src/@types/default-resource.ts | 11 +- src/renderer/src/@types/i18next.d.ts | 5 +- .../src/components/ui/datetime/index.tsx | 13 +- src/renderer/src/components/ui/kbd/Kbd.tsx | 9 +- .../ui/markdown/components/TimeStamp.tsx | 2 +- src/renderer/src/components/user-button.tsx | 4 +- .../src/components/view-select-content.tsx | 29 +- src/renderer/src/constants/copy.ts | 3 +- src/renderer/src/constants/shortcuts.ts | 39 ++- src/renderer/src/constants/tabs.tsx | 25 +- src/renderer/src/global.d.ts | 11 +- .../src/hooks/biz/useEntryActions.tsx | 27 +- src/renderer/src/hooks/biz/useFeedActions.tsx | 30 +- src/renderer/src/i18n.ts | 68 +++-- src/renderer/src/main.tsx | 2 +- .../src/modules/ai/ai-daily/daily.tsx | 82 +++--- .../src/modules/ai/ai-daily/hooks.tsx | 22 +- .../src/modules/discover/DiscoverFeedForm.tsx | 50 ++-- .../src/modules/discover/feed-form.tsx | 43 ++- src/renderer/src/modules/discover/form.tsx | 14 +- src/renderer/src/modules/discover/import.tsx | 8 +- .../src/modules/discover/recommendations.tsx | 4 +- .../components/mark-all-button.tsx | 64 +++-- .../src/modules/entry-column/index.tsx | 6 +- .../entry-column/layouts/EntryItemWrapper.tsx | 7 +- .../entry-column/layouts/EntryListHeader.tsx | 36 ++- .../src/modules/entry-column/lists.tsx | 4 +- .../src/modules/entry-content/index.tsx | 17 +- .../feed-column/category-remove-dialog.tsx | 16 +- .../src/modules/feed-column/category.tsx | 19 +- .../src/modules/feed-column/header.tsx | 12 +- .../src/modules/feed-column/index.tsx | 7 +- src/renderer/src/modules/feed-column/list.tsx | 11 +- src/renderer/src/modules/modal/shortcuts.tsx | 10 +- .../modules/profile/profile-setting-form.tsx | 16 +- .../src/modules/settings/action-card.tsx | 261 ++++++++++-------- .../src/modules/settings/constants.ts | 2 +- .../modules/settings/helper/SyncIndicator.tsx | 6 +- .../src/modules/settings/modal/content.tsx | 27 +- .../src/modules/settings/sections/fonts.tsx | 14 +- .../src/modules/settings/tabs/about.tsx | 182 ++++++------ .../src/modules/settings/tabs/apperance.tsx | 63 ++--- .../src/modules/settings/tabs/general.tsx | 61 ++-- .../src/modules/settings/tabs/integration.tsx | 32 +-- .../src/modules/settings/tabs/invitations.tsx | 59 ++-- .../modules/settings/tabs/wallet/index.tsx | 3 - .../my-wallet-section/claim-daily-reward.tsx | 16 +- .../my-wallet-section/create-wallet.tsx | 18 +- .../tabs/wallet/my-wallet-section/index.tsx | 141 +++++----- .../wallet/my-wallet-section/withdraw.tsx | 38 ++- .../tabs/wallet/transaction-section/index.tsx | 58 ++-- src/renderer/src/modules/settings/title.tsx | 4 +- src/renderer/src/modules/settings/utils.ts | 3 +- .../src/pages/(external)/invitation.tsx | 8 +- .../(layer)/(subview)/discover/index.tsx | 24 +- .../pages/(main)/(layer)/(subview)/hooks.ts | 4 +- .../pages/(main)/(layer)/(subview)/layout.tsx | 8 +- .../(main)/(layer)/feeds/[feedId]/layout.tsx | 4 +- src/renderer/src/pages/(main)/layout.tsx | 51 ++-- .../src/pages/settings/(settings)/about.tsx | 2 +- .../src/pages/settings/(settings)/actions.tsx | 13 +- .../pages/settings/(settings)/appearance.tsx | 11 +- .../src/pages/settings/(settings)/general.tsx | 3 +- .../pages/settings/(settings)/integration.tsx | 3 +- .../pages/settings/(settings)/invitations.tsx | 3 +- .../src/pages/settings/(settings)/profile.tsx | 3 +- .../pages/settings/(settings)/shortcuts.tsx | 7 +- .../src/pages/settings/(settings)/wallet.tsx | 3 +- src/renderer/src/providers/i18n-provider.tsx | 15 +- src/renderer/src/store/feed/hooks.ts | 8 +- 88 files changed, 1842 insertions(+), 1009 deletions(-) create mode 100644 locales/app/zh-CN.json delete mode 100644 locales/app/zh_CN.json create mode 100644 locales/common/zh-CN.json delete mode 100644 locales/common/zh_CN.json create mode 100644 locales/lang/zh-CN.json delete mode 100644 locales/lang/zh_CN.json create mode 100644 locales/settings/en.json create mode 100644 locales/settings/zh-CN.json create mode 100644 locales/shortcuts/en.json create mode 100644 locales/shortcuts/zh-CN.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 5fd2a1225..946204557 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -61,13 +61,7 @@ "typescript.tsdk": "node_modules/typescript/lib", "i18n-ally.enabledFrameworks": ["i18next"], "i18n-ally.displayLanguage": "en", - "i18n-ally.localesPaths": [ - // "locales/app", - // "locales/lang", - // "locales/common", - "locales/**/*" - ] - // "i18n-ally.namespace": true, - // "i18n-ally.pathMatcher": "{namespace}/{locale}.json", - // "i18n-ally.defaultNamespace": "app", + "i18n-ally.localesPaths": ["locales"], + "i18n-ally.namespace": true, + "i18n-ally.pathMatcher": "{namespaces}/{locale}.json" } diff --git a/configs/vite.render.config.ts b/configs/vite.render.config.ts index 7173d08e2..aa5949d1a 100644 --- a/configs/vite.render.config.ts +++ b/configs/vite.render.config.ts @@ -57,6 +57,11 @@ export const viteRenderBaseConfig = { { name: "custom-i18n-hmr", handleHotUpdate({ file, server }) { + server.ws.send({ + type: "custom", + event: "hmr", + data: {}, + }) if (file.endsWith(".json") && file.includes("locales")) { server.ws.send({ type: "custom", diff --git a/eslint.config.mjs b/eslint.config.mjs index be55c956d..8f4c53767 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -32,4 +32,22 @@ export default defineConfig( ], }, }, + { + files: ["**/*.tsx"], + rules: { + "@stylistic/jsx-self-closing-comp": "error", + }, + }, + { + files: ["locales/**/*.json"], + rules: { + "jsonc/sort-keys": [ + "error", + { + pathPattern: ".*", + order: { type: "asc" }, + }, + ], + }, + }, ) diff --git a/locales/app/en.json b/locales/app/en.json index 9cf3d46f7..5839f757e 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -1,108 +1,122 @@ { - "words": { - "search": "Search", - "import": "Import", - "discover": "Discover", - "language": "Language" - }, - "signin": { - "continue_with_github": "Continue with GitHub", - "continue_with_google": "Continue with Google", - "sign_in_to": "Sign in to" - }, - "settings": { - "titles": { - "general": "General", - "appearance": "Appearance", - "actions": "Actions", - "integration": "Integration", - "about": "About", - "profile": "Profile", - "shortcuts": "Shortcuts", - "power": "Power", - "invitations": "Invitations" - }, - "general": { - "app": "App", - "launch_at_login": "Launch at login", - "timeline": "Timeline", - "show_unread_on_launch": { - "description": "Show unread content on launch", - "label": "Show unread content on launch" - }, - "rebuild_database": { - "warning": { - "line1": "Rebuilding the database will clear all your local data.", - "line2": "Are you sure you want to continue?" - }, - "label": "Rebuild Database", - "description": "If you are experiencing rendering issues, rebuilding the database may solve them.", - "button": "Rebuild", - "title": "Rebuild Database" - }, - "group_by_date": { - "label": "Group by date", - "description": "Group entries by date." - }, - "mark_as_read": { - "scroll": { - "label": "Mark as read when scrolling", - "description": "Automatically mark entries as read when scrolled out of the view." - }, - "hover": { - "label": "Mark as read when hovering", - "description": "Automatically mark entries as read when hovered." - }, - "render": { - "label": "Mark as read when in the view", - "description": "Automatically mark single-level entries (e.g. social media posts, pictures, video views) as read when they enter the view." - } - }, - "privacy_data": "Privacy & Data", - "data_persist": { - "label": "Persist data for offline usage", - "description": "Persist data locally to enable offline access and local search." - }, - "send_anonymous_data": { - "label": "Send anonymous data", - "description": "By opting to send anonymized telemetry data, you contribute to improving the overall user experience of Follow." - }, - "voices": "Voices" - }, - "integration": { - "title": "Integration", - "eagle": { - "title": "Eagle", - "enable": { - "label": "Enable", - "description": "Display 'Save media to Eagle' button when available." - } - }, - "readwise": { - "title": "Readwise", - "enable": { - "label": "Enable", - "description": "Display 'Save to Readwise' button when available." - }, - "token": { - "label": "Readwise Access Token", - "description": "You can get it here: readwise.io/access_token." - } - }, - "instapaper": { - "title": "Instapaper", - "enable": { - "label": "Enable", - "description": "Display 'Save to Instapaper' button when available." - }, - "username": { - "label": "Instapaper Username" - }, - "password": { - "label": "Instapaper Password" - } - }, - "tip": "Tip: Your sensitive data is stored locally and is not uploaded to the server." - } - } + "ai_daily.title": "Top News - {{title}}", + "ai_daily.tooltip.content": "Here is news selected by AI from your timeline ( - ) that may be important to you.", + "ai_daily.tooltip.update_schedule": "Update daily at 8 AM and 8 PM.", + "discover.any_url_or_keyword": "Any URL or Keyword", + "discover.default_option": " (default)", + "discover.feed_description": "The description of this feed is as follows, and you can fill out the parameter form with the relevant information.", + "discover.feed_maintainers": "This feed is provided by RSSHub, with credit to ", + "discover.import.click_to_upload": "Click to upload OPML file", + "discover.popular": "Popular", + "discover.preview": "Preview", + "discover.rss_hub_route": "RSSHub Route", + "discover.rss_url": "RSS URL", + "discover.select_placeholder": "Select", + "early_access": "Early Access", + "entry_actions.copy_link": "Copy link", + "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.share": "Share", + "entry_actions.star": "Star", + "entry_actions.tip": "Tip", + "entry_actions.unstar": "Unstar", + "entry_column.refreshing": "Refreshing new entries...", + "entry_content.ai_summary": "AI summary", + "entry_content.fetching_content": "Fetching original content and processing...", + "entry_content.no_content": "No content", + "entry_content.readability_notice": "This content is provided by Readability. If you find typographical anomalies, please go to the source site to view the original content.", + "entry_content.render_error": "Render error:", + "entry_content.report_issue": "Report issue", + "entry_content.web_app_notice": "Maybe web app doesn't support this content type. But you can download the desktop app.", + "entry_list_header.daily_report": "Daily Report", + "entry_list_header.items": "items", + "entry_list_header.new_entries_available": "New entries available", + "entry_list_header.refetch": "Refetch", + "entry_list_header.refresh": "Refresh", + "entry_list_header.show_all": "Show all", + "entry_list_header.show_unread_only": "Show unread Only", + "entry_list_header.switch_to_grid": "Switch to Grid", + "entry_list_header.switch_to_masonry": "Switch to Masonry", + "entry_list_header.unread": "unread", + "feed_form.add_follow": "Add follow", + "feed_form.category": "Category", + "feed_form.category_description": "By default, your follows will be grouped by website.", + "feed_form.error_fetching_feed": "Error in fetching feed.", + "feed_form.fallback": "Fallback", + "feed_form.feed_not_found": "Feed not found.", + "feed_form.follow": "Follow", + "feed_form.followed": "🎉 Followed.", + "feed_form.private_follow": "Private Follow", + "feed_form.private_follow_description": "Whether this follow is publicly visible on your profile page.", + "feed_form.retry": "Retry", + "feed_form.title": "Title", + "feed_form.title_description": "Custom title for this Feed. Leave empty to use the default.", + "feed_form.unfollow": "Unfollow", + "feed_form.update": "Update", + "feed_form.update_follow": "Update follow", + "feed_form.updated": "🎉 Updated.", + "feed_form.view": "View", + "feed_view_type.articles": "Articles", + "feed_view_type.audios": "Audios", + "feed_view_type.notifications": "Notifications", + "feed_view_type.pictures": "Pictures", + "feed_view_type.social_media": "Social Media", + "feed_view_type.videos": "Videos", + "mark_all_read_button.auto_confirm_info": "Will be confirmed automatically after 3s.", + "mark_all_read_button.confirm": "Confirm", + "mark_all_read_button.confirm_mark_all": "Mark {{which}} as read?", + "mark_all_read_button.confirm_mark_all_info": "Confirm mark all as read?", + "mark_all_read_button.mark_all_as_read": "Mark all as read", + "mark_all_read_button.mark_as_read": "Mark {{which}} as read", + "mark_all_read_button.undo": "Undo", + "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.", + "sidebar.category_remove_dialog.title": "Remove Category", + "sidebar.feed_actions.claim": "Claim", + "sidebar.feed_actions.claim_feed": "Claim Feed", + "sidebar.feed_actions.copy_feed_id": "Copy feed ID", + "sidebar.feed_actions.copy_feed_url": "Copy feed URL", + "sidebar.feed_actions.edit": "Edit", + "sidebar.feed_actions.edit_feed": "Edit feed", + "sidebar.feed_actions.feed_owned_by_you": "This feed is owned by you", + "sidebar.feed_actions.mark_all_as_read": "Mark all as read", + "sidebar.feed_actions.navigate_to_feed": "Navigate to feed", + "sidebar.feed_actions.open_feed_in_browser": "Open feed in browser", + "sidebar.feed_actions.open_site_in_browser": "Open site in browser", + "sidebar.feed_actions.unfollow": "Unfollow", + "sidebar.feed_actions.unfollow_feed": "Unfollow feed", + "sidebar.feed_column.context_menu.change_to_other_view": "Change to other view", + "sidebar.feed_column.context_menu.delete_category": "Delete category", + "sidebar.feed_column.context_menu.delete_category_confirmation": "Delete category {{folderName}}?", + "sidebar.feed_column.context_menu.mark_as_read": "Mark as read", + "sidebar.feed_column.context_menu.rename_category": "Rename category", + "sidebar.select_sort_method": "Select a sort method", + "signin.continue_with_github": "Continue with GitHub", + "signin.continue_with_google": "Continue with Google", + "signin.sign_in_to": "Sign in to", + "sync_indicator.offline": "Offline", + "sync_indicator.synced": "Synced with server", + "words.add": "Add", + "words.confirm": "Confirm", + "words.discover": "Discover", + "words.email": "Email", + "words.import": "Import", + "words.items": "Items", + "words.language": "Language", + "words.load_archived_entries": "Load archived entries", + "words.login": "Login", + "words.rss": "RSS", + "words.rss3": "RSS3", + "words.rsshub": "RSSHub", + "words.search": "Search", + "words.starred": "Starred", + "words.unread": "Unread", + "words.user": "User", + "words.which.all": "all", + "words.zero_items": "Zero items" } diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json new file mode 100644 index 000000000..151373ef2 --- /dev/null +++ b/locales/app/zh-CN.json @@ -0,0 +1,119 @@ +{ + "ai_daily.title": "头条 - {{title}}", + "ai_daily.tooltip.content": "这里是通过 AI 从您的时间线中选择的头条新闻( - ),可能对您很重要。", + "ai_daily.tooltip.update_schedule": "每天早上 8 点、晚上 8 点更新。", + "discover.any_url_or_keyword": "任何 URL 或关键词", + "discover.default_option": " (默认)", + "discover.feed_description": "此 Feed 的描述如下,您可以填写相关信息。", + "discover.feed_maintainers": "此 Feed 由 RSSHub 提供,感谢 ", + "discover.import.click_to_upload": "点击上传 OPML 文件以导入", + "discover.popular": "热门", + "discover.preview": "预览", + "discover.rss_hub_route": "RSSHub 路由", + "discover.rss_url": "RSS URL", + "discover.select_placeholder": "选择", + "early_access": "早期预览版本", + "entry_actions.copy_link": "复制链接", + "entry_actions.mark_as_read": "标记为已读", + "entry_actions.mark_as_unread": "标记为未读", + "entry_actions.open_in_browser": "在浏览器中打开", + "entry_actions.save_media_to_eagle": "将媒体保存到 Eagle", + "entry_actions.save_to_instapaper": "保存到 Instapaper", + "entry_actions.save_to_readwise": "保存到 Readwise", + "entry_actions.share": "分享", + "entry_actions.star": "收藏", + "entry_actions.tip": "打赏", + "entry_actions.unstar": "取消收藏", + "entry_column.refreshing": "正在刷新", + "entry_content.ai_summary": "AI 总结", + "entry_content.fetching_content": "正在获取原始内容并进行处理...", + "entry_content.no_content": "没有内容", + "entry_content.readability_notice": "此内容由 Readability 提供。\n如果您发现排版异常,请前往来源站点查看原始内容。", + "entry_content.render_error": "渲染错误:", + "entry_content.report_issue": "报告问题", + "entry_content.web_app_notice": "Web 应用可能不支持此内容类型。但您可以下载桌面应用。", + "entry_list_header.daily_report": "每日报告", + "entry_list_header.items": "内容", + "entry_list_header.new_entries_available": "有新内容", + "entry_list_header.refetch": "重新获取", + "entry_list_header.refresh": "刷新", + "entry_list_header.show_all": "显示全部", + "entry_list_header.show_unread_only": "仅显示未读", + "entry_list_header.switch_to_grid": "切换到网格", + "entry_list_header.switch_to_masonry": "切换到瀑布流", + "entry_list_header.unread": "未读", + "feed_form.add_follow": "添加关注", + "feed_form.category": "分类", + "feed_form.category_description": "默认情况下,您的关注将按网站分组。", + "feed_form.error_fetching_feed": "获取 Feed 时出错。", + "feed_form.fallback": "备选方案", + "feed_form.feed_not_found": "未找到 Feed。", + "feed_form.follow": "关注", + "feed_form.followed": "🎉 已关注。", + "feed_form.private_follow": "私密关注", + "feed_form.private_follow_description": "此关注是否在您的个人资料页面公开可见。", + "feed_form.retry": "重试", + "feed_form.title": "标题", + "feed_form.title_description": "此 Feed 的自定义标题。留空则使用默认标题。", + "feed_form.unfollow": "取消关注", + "feed_form.update": "更新", + "feed_form.update_follow": "更新关注", + "feed_form.updated": "🎉 已更新。", + "feed_form.view": "视图", + "feed_view_type.articles": "文章", + "feed_view_type.audios": "音频", + "feed_view_type.notifications": "通知", + "feed_view_type.pictures": "图片", + "feed_view_type.social_media": "社交媒体", + "feed_view_type.videos": "视频", + "mark_all_read_button.auto_confirm_info": "3 秒后自动确认。", + "mark_all_read_button.confirm": "确认", + "mark_all_read_button.confirm_mark_all": "将{{which}}标记为已读?", + "mark_all_read_button.confirm_mark_all_info": "确认将全部标记为已读?", + "mark_all_read_button.mark_all_as_read": "全部标记为已读", + "mark_all_read_button.mark_as_read": "标记{{which}}为已读", + "mark_all_read_button.undo": "撤消", + "sidebar.category_remove_dialog.cancel": "取消", + "sidebar.category_remove_dialog.continue": "继续", + "sidebar.category_remove_dialog.description": "此操作将删除您的类别,但其中包含的 Feed 将保留并按网站分组。", + "sidebar.category_remove_dialog.title": "删除类别", + "sidebar.feed_actions.claim": "认领", + "sidebar.feed_actions.claim_feed": "认领 Feed", + "sidebar.feed_actions.copy_feed_id": "复制 Feed ID", + "sidebar.feed_actions.copy_feed_url": "复制 Feed URL", + "sidebar.feed_actions.edit": "编辑", + "sidebar.feed_actions.edit_feed": "编辑 Feed", + "sidebar.feed_actions.feed_owned_by_you": "此 Feed 归您所有", + "sidebar.feed_actions.mark_all_as_read": "全部标记为已读", + "sidebar.feed_actions.navigate_to_feed": "跳转至 Feed", + "sidebar.feed_actions.open_feed_in_browser": "在浏览器中打开 Feed", + "sidebar.feed_actions.open_site_in_browser": "在浏览器中打开网站", + "sidebar.feed_actions.unfollow": "取消关注", + "sidebar.feed_actions.unfollow_feed": "取消关注 Feed", + "sidebar.feed_column.context_menu.change_to_other_view": "更改为其他视图", + "sidebar.feed_column.context_menu.delete_category": "删除类别", + "sidebar.feed_column.context_menu.delete_category_confirmation": "删除类别 {{folderName}}?", + "sidebar.feed_column.context_menu.mark_as_read": "标记为已读", + "sidebar.feed_column.context_menu.rename_category": "重命名类别", + "sidebar.select_sort_method": "选择排序方法", + "signin.continue_with_github": "使用 GitHub 登录", + "signin.continue_with_google": "使用 Google 登录", + "signin.sign_in_to": "登录到", + "sync_indicator.offline": "离线", + "sync_indicator.synced": "已与服务器同步", + "words.add": "添加", + "words.confirm": "确认", + "words.discover": "发现", + "words.email": "邮箱", + "words.import": "导入", + "words.items": "内容", + "words.language": "语言", + "words.load_archived_entries": "加载已归档条目", + "words.login": "登录", + "words.search": "搜索", + "words.starred": "收藏", + "words.unread": "未读", + "words.user": "用户", + "words.which.all": "全部", + "words.zero_items": "没有内容" +} diff --git a/locales/app/zh_CN.json b/locales/app/zh_CN.json deleted file mode 100644 index 46cd0b576..000000000 --- a/locales/app/zh_CN.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "words": { - "search": "搜索", - "import": "导入", - "discover": "发现", - "language": "语言" - }, - "signin": { - "continue_with_github": "使用 GitHub 登录", - "continue_with_google": "使用 Google 登录", - "sign_in_to": "登录到" - }, - "settings": { - "titles": { - "general": "常规", - "appearance": "外观", - "actions": "操作", - "integration": "集成", - "about": "关于", - "profile": "个人资料", - "shortcuts": "热键", - "power": "Power", - "invitations": "邀请" - }, - "general": { - "app": "应用程序", - "data_persist": { - "description": "在本地保留数据以启用离线访问和本地搜索。", - "label": "保留数据以供离线使用" - }, - "group_by_date": { - "description": "按日期对条目进行分组。", - "label": "按日期分组" - }, - "launch_at_login": "登录时启动", - "mark_as_read": { - "hover": { - "description": "悬停时自动将条目标记为已读。", - "label": "悬停时标记为已读" - }, - "render": { - "description": "当单级条目(例如社交媒体帖子、图片、视频视图)进入视图时自动将其标记为已读。", - "label": "在视图中标记为已读" - }, - "scroll": { - "description": "当滚动出视图时自动将条目标记为已读。", - "label": "滚动时标记为已读" - } - }, - "privacy_data": "隐私", - "rebuild_database": { - "button": "重建", - "description": "如果您遇到渲染问题,重建数据库可能会解决这些问题。", - "label": "重建数据库", - "title": "重建数据库", - "warning[0]": "重建数据库将清除所有本地数据。", - "warning[1]": "您确定要继续吗?", - "warning": { - "line1": "重建数据库将清除所有本地数据。", - "line2": "您确定要继续吗?" - } - }, - "send_anonymous_data": { - "description": "通过选择发送匿名遥测数据,您可以为改善“关注”的整体用户体验做出贡献。", - "label": "发送匿名数据" - }, - "show_unread_on_launch": { - "description": "启动时显示未读内容", - "label": "启动时显示未读内容" - }, - "timeline": "时间轴", - "voices": "声音" - } - } -} diff --git a/locales/common/en.json b/locales/common/en.json index 434f2f1c1..8e5c17f32 100644 --- a/locales/common/en.json +++ b/locales/common/en.json @@ -1,8 +1,19 @@ { + "cancel": "Cancel", "confirm": "Confirm", "ok": "OK", - "cancel": "Cancel", - "tips": { - "load-lng-error": "Failed to load language pack" - } + "quantifier.piece": "", + "time.last_night": "Last Night", + "time.the_night_before_last": "The Night Before Last", + "time.today": "Today", + "time.yesterday": "Yesterday", + "tips.load-lng-error": "Failed to load language pack", + "words.back": "Back", + "words.copy": "Copy", + "words.entry": "Entry", + "words.id": "ID", + "words.items_one": "Item", + "words.items_other": "Items", + "words.space": " ", + "words.which.all": "All" } diff --git a/locales/common/zh-CN.json b/locales/common/zh-CN.json new file mode 100644 index 000000000..459bc2fa8 --- /dev/null +++ b/locales/common/zh-CN.json @@ -0,0 +1,20 @@ +{ + "cancel": "取消", + "confirm": "确认", + "ok": "好", + "quantifier.piece": "条", + "time.last_night": "昨天晚上", + "time.the_night_before_last": "前天晚上", + "time.today": "今天", + "time.yesterday": "昨天", + "tips.load-lng-error": "加载语言包失败", + "words.back": "返回", + "words.copy": "复制", + "words.entry": "条目", + "words.id": "ID", + "words.items": "内容", + "words.items_one": "内容", + "words.items_other": "内容", + "words.space": "", + "words.which.all": "全部" +} diff --git a/locales/common/zh_CN.json b/locales/common/zh_CN.json deleted file mode 100644 index b07eacdbf..000000000 --- a/locales/common/zh_CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "confirm": "确认", - "ok": "好", - "cancel": "取消", - "tips": { - "load-lng-error": "加载语言包失败" - } -} diff --git a/locales/external/en.json b/locales/external/en.json index 0b8063199..64b46f351 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -1,8 +1,8 @@ { "redirect": { - "successMessage": "You have successfully connected to {{APP_NAME}} Account.", - "instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", "continueInBrowser": "Continue in Browser", - "openApp": "Open {{APP_NAME}}" + "instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", + "openApp": "Open {{APP_NAME}}", + "successMessage": "You have successfully connected to {{APP_NAME}} Account." } } diff --git a/locales/lang/en.json b/locales/lang/en.json index 85a3d0847..e6f2d29f5 100644 --- a/locales/lang/en.json +++ b/locales/lang/en.json @@ -1,7 +1,5 @@ { - "name": "English", - "langs": { - "en": "English", - "zh_CN": "简体中文(部分完成)" - } + "langs.en": "English", + "langs.zh-CN": "简体中文(部分完成)", + "name": "English" } diff --git a/locales/lang/zh-CN.json b/locales/lang/zh-CN.json new file mode 100644 index 000000000..e6f2d29f5 --- /dev/null +++ b/locales/lang/zh-CN.json @@ -0,0 +1,5 @@ +{ + "langs.en": "English", + "langs.zh-CN": "简体中文(部分完成)", + "name": "English" +} diff --git a/locales/lang/zh_CN.json b/locales/lang/zh_CN.json deleted file mode 100644 index 6c2d1e6a6..000000000 --- a/locales/lang/zh_CN.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "English" -} diff --git a/locales/settings/en.json b/locales/settings/en.json new file mode 100644 index 000000000..04f69a274 --- /dev/null +++ b/locales/settings/en.json @@ -0,0 +1,194 @@ +{ + "about.changelog": "Changelog", + "about.feedbackInfo": "{{appName}} ({{commitSha}}) is in the early stages of development. If you have any feedback or suggestions, please feel free to open an issue on our GitHub.", + "about.iconLibrary": "The icon library used is copyrighted by and cannot be redistributed.", + "about.licenseInfo": "{{appName}} is and will always be a free and open-source project. It is licensed under {{license}}.", + "about.sidebar_title": "About", + "about.socialMedia": "Social Media", + "actions.actionName": "Action {{number}}", + "actions.action_card.add": "Add", + "actions.action_card.all": "All", + "actions.action_card.block_rules": "Block Rules", + "actions.action_card.custom_filters": "Custom filters", + "actions.action_card.entry_options.all": "All", + "actions.action_card.entry_options.author": "Author", + "actions.action_card.entry_options.content": "Content", + "actions.action_card.entry_options.order": "Order", + "actions.action_card.entry_options.title": "Title", + "actions.action_card.entry_options.url": "Url", + "actions.action_card.feed_options.category": "Category", + "actions.action_card.feed_options.feed_url": "Feed URL", + "actions.action_card.feed_options.site_url": "Site URL", + "actions.action_card.feed_options.title": "Title", + "actions.action_card.feed_options.view": "View", + "actions.action_card.field": "Field", + "actions.action_card.from": "From", + "actions.action_card.generate_summary": "Generate summary using AI", + "actions.action_card.name": "Name", + "actions.action_card.operation_options.contains": "contains", + "actions.action_card.operation_options.does_not_contain": "does not contain", + "actions.action_card.operation_options.is_equal_to": "is equal to", + "actions.action_card.operation_options.is_greater_than": "is greater than", + "actions.action_card.operation_options.is_less_than": "is less than", + "actions.action_card.operation_options.is_not_equal_to": "is not equal to", + "actions.action_card.operation_options.matches_regex": "matches regex", + "actions.action_card.operator": "Operator", + "actions.action_card.rewrite_rules": "Rewrite Rules", + "actions.action_card.then_do": "Then do…", + "actions.action_card.to": "To", + "actions.action_card.translate_into": "Translate into", + "actions.action_card.value": "Value", + "actions.action_card.when_feeds_match": "When feeds match…", + "actions.newRule": "New Rule", + "actions.save": "Save", + "actions.saveSuccess": "🎉 Actions saved.", + "actions.sidebar_title": "Actions", + "actions.title": "Actions", + "appearance.code_highlight_theme": "Code highlight theme", + "appearance.content": "Content", + "appearance.content_font": "Content Font", + "appearance.custom_font": "Custom Font", + "appearance.fonts": "Fonts", + "appearance.general": "General", + "appearance.guess_code_language.description": "Major programming languages that use models to infer unlabeled code blocks", + "appearance.guess_code_language.label": "Guess code language", + "appearance.misc": "Misc", + "appearance.modal_overlay.description": "Show modal overlay", + "appearance.modal_overlay.label": "Show modal overlay", + "appearance.opaque_sidebars.label": "Opaque sidebars", + "appearance.reader_render_inline_style.description": "Allows rendering of the inline style of the original HTML.", + "appearance.reader_render_inline_style.label": "Render inline style", + "appearance.reduce_motion.description": "Reducing the motion of elements to improve performance and reduce energy consumption", + "appearance.reduce_motion.label": "Reduce motion", + "appearance.save": "Save", + "appearance.show_dock_badge.label": "Show as Dock badge", + "appearance.sidebar_show_unread_count.label": "Show in sidebar", + "appearance.sidebar_title": "Appearance", + "appearance.text_size": "Text size", + "appearance.theme.dark": "Dark", + "appearance.theme.label": "Theme", + "appearance.theme.light": "Light", + "appearance.theme.system": "System", + "appearance.title": "Appearance", + "appearance.ui_font": "UI Font", + "appearance.unread_count": "Unread count", + "general.app": "App", + "general.data_persist.description": "Persist data locally to enable offline access and local search.", + "general.data_persist.label": "Persist data for offline usage", + "general.group_by_date.description": "Group entries by date.", + "general.group_by_date.label": "Group by date", + "general.language": "Language", + "general.launch_at_login": "Launch at login", + "general.mark_as_read.hover.description": "Automatically mark entries as read when hovered.", + "general.mark_as_read.hover.label": "Mark as read when hovering", + "general.mark_as_read.render.description": "Automatically mark single-level entries (e.g. social media posts, pictures, video views) as read when they enter the view.", + "general.mark_as_read.render.label": "Mark as read when in the view", + "general.mark_as_read.scroll.description": "Automatically mark entries as read when scrolled out of the view.", + "general.mark_as_read.scroll.label": "Mark as read when scrolling", + "general.privacy_data": "Privacy & Data", + "general.rebuild_database.button": "Rebuild", + "general.rebuild_database.description": "If you are experiencing rendering issues, rebuilding the database may solve them.", + "general.rebuild_database.label": "Rebuild Database", + "general.rebuild_database.title": "Rebuild Database", + "general.rebuild_database.warning.line1": "Rebuilding the database will clear all your local data.", + "general.rebuild_database.warning.line2": "Are you sure you want to continue?", + "general.send_anonymous_data.description": "By opting to send anonymized telemetry data, you contribute to improving the overall user experience of Follow.", + "general.send_anonymous_data.label": "Send anonymous data", + "general.show_unread_on_launch.description": "Show unread content on launch", + "general.show_unread_on_launch.label": "Show unread content on launch", + "general.sidebar_title": "General", + "general.timeline": "Timeline", + "general.unread": "Unread", + "general.voices": "Voices", + "integration.eagle.enable.description": "Display 'Save media to Eagle' button when available.", + "integration.eagle.enable.label": "Enable", + "integration.eagle.title": "Eagle", + "integration.instapaper.enable.description": "Display 'Save to Instapaper' button when available.", + "integration.instapaper.enable.label": "Enable", + "integration.instapaper.password.label": "Instapaper Password", + "integration.instapaper.title": "Instapaper", + "integration.instapaper.username.label": "Instapaper Username", + "integration.readwise.enable.description": "Display 'Save to Readwise' button when available.", + "integration.readwise.enable.label": "Enable", + "integration.readwise.title": "Readwise", + "integration.readwise.token.description": "You can get it here: readwise.io/access_token.", + "integration.readwise.token.label": "Readwise Access Token", + "integration.sidebar_title": "Integration", + "integration.tip": "Tip: Your sensitive data is stored locally and is not uploaded to the server.", + "integration.title": "Integration", + "invitation.activate": "Activate", + "invitation.codeOptions.betaUser": "1. Find a beta user who invites you.", + "invitation.codeOptions.discord": "2. Join our Discord server and occasionally get gifts.", + "invitation.codeOptions.xAccount": "3. Follow our X account, and get gifts from time to time.", + "invitation.confirmModal.cancel": "Cancel", + "invitation.confirmModal.confirm": "Do you want to continue?", + "invitation.confirmModal.continue": "Continue", + "invitation.confirmModal.message": "Generating an invitation code will cost you {{INVITATION_PRICE}} Power.", + "invitation.confirmModal.title": "Confirm", + "invitation.earlyAccess": "Follow is currently in early access and requires an invitation code to use.", + "invitation.earlyAccessMessage": "😰 Sorry, Follow is currently in early access and requires an invitation code to use.", + "invitation.generateButton": "Generate new code", + "invitation.generateCost": "You can spend {{INVITATION_PRICE}} Power to generate an invitation code for your friends.", + "invitation.getCodeMessage": "You can get an invitation code through the following methods:", + "invitation.newInvitationSuccess": "🎉 New invitation generated, invite code is copied", + "invitation.noInvitations": "No invitations", + "invitation.notUsed": "Not used", + "invitation.sidebar_title": "Invitations", + "invitation.tableHeaders.code": "Code", + "invitation.tableHeaders.creationTime": "Creation Time", + "invitation.tableHeaders.usedBy": "Used by", + "invitation.title": "Invitation Code", + "profile.avatar.label": "Avatar", + "profile.handle.description": "Your unique identifier.", + "profile.handle.label": "Handle", + "profile.name.description": "Your public display name.", + "profile.name.label": "Display Name", + "profile.sidebar_title": "Profile", + "profile.submit": "Submit", + "profile.title": "Profile Settings", + "profile.updateSuccess": "Profile updated.", + "titles.about": "About", + "titles.actions": "Actions", + "titles.appearance": "Appearance", + "titles.general": "General", + "titles.integration": "Integration", + "titles.invitations": "Invitations", + "titles.power": "Power", + "titles.profile": "Profile", + "titles.shortcuts": "Shortcuts", + "wallet.address.title": "Your Address", + "wallet.balance.title": "Your Balance", + "wallet.balance.withdrawable": "Withdrawable", + "wallet.balance.withdrawableTooltip": "Withdrawable Power includes both the tips you've received and the Power you've recharged.", + "wallet.claim.button.claim": "Claim Daily Power", + "wallet.claim.button.claimed": "Claimed today", + "wallet.claim.tooltip.alreadyClaimed": "You have already claimed today.", + "wallet.claim.tooltip.canClaim": "Claim your {{amount}} Daily Power now!", + "wallet.create.button": "Create Wallet", + "wallet.create.description": "Create a free wallet to receive Power, which can be used to reward creators and also get rewarded for your content contributions.", + "wallet.power.dailyClaim": "You can claim {{amount}} free Power daily, which can be used to tip RSS entries on Follow.", + "wallet.power.description": "Power is an ERC-20 token on the {{blockchainName}} blockchain.", + "wallet.sidebar_title": "Power", + "wallet.transactions.amount": "Amount", + "wallet.transactions.date": "Date", + "wallet.transactions.from": "From", + "wallet.transactions.noTransactions": "No transactions", + "wallet.transactions.title": "Transactions", + "wallet.transactions.to": "To", + "wallet.transactions.tx": "Tx", + "wallet.transactions.type": "Type", + "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": "You", + "wallet.withdraw.addressLabel": "Your Ethereum Address", + "wallet.withdraw.amountLabel": "Amount", + "wallet.withdraw.availableBalance": "You have withdrawable Power in your wallet.", + "wallet.withdraw.button": "Withdraw", + "wallet.withdraw.error": "Withdrawal failed: {{error}}", + "wallet.withdraw.modalTitle": "Withdraw Power", + "wallet.withdraw.submitButton": "Submit", + "wallet.withdraw.success": "Withdrawal successful!" +} diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json new file mode 100644 index 000000000..66cf47942 --- /dev/null +++ b/locales/settings/zh-CN.json @@ -0,0 +1,196 @@ +{ + "about.changelog": "更新日志", + "about.feedbackInfo": "{{appName}} ({{commitSha}}) 正处于开发的早期阶段。\n如果您有任何反馈或建议,请随时在我们的 GitHub 上提出问题 ", + "about.iconLibrary": "使用的图标库版权归 所有,不能重新分发。", + "about.licenseInfo": "{{appName}} 现在和将来都是一个免费的开源项目。开源协议为 {{license}} 。", + "about.sidebar_title": "关于", + "about.socialMedia": "社交媒体", + "actions.actionName": "指令 {{number}}", + "actions.action_card.add": "添加", + "actions.action_card.all": "全部", + "actions.action_card.block_rules": "阻止规则", + "actions.action_card.custom_filters": "过滤", + "actions.action_card.entry_options.all": "全部", + "actions.action_card.entry_options.author": "作者", + "actions.action_card.entry_options.content": "内容", + "actions.action_card.entry_options.order": "顺序", + "actions.action_card.entry_options.title": "标题", + "actions.action_card.entry_options.url": "URL", + "actions.action_card.feed_options.category": "类别", + "actions.action_card.feed_options.feed_url": "Feed 地址", + "actions.action_card.feed_options.site_url": "网站 URL", + "actions.action_card.feed_options.title": "标题", + "actions.action_card.feed_options.view": "视图", + "actions.action_card.field": "字段", + "actions.action_card.from": "从", + "actions.action_card.generate_summary": "使用 AI 生成摘要", + "actions.action_card.name": "名称", + "actions.action_card.operation_options.contains": "包含", + "actions.action_card.operation_options.does_not_contain": "不包含", + "actions.action_card.operation_options.is_equal_to": "等于", + "actions.action_card.operation_options.is_greater_than": "大于", + "actions.action_card.operation_options.is_less_than": "小于", + "actions.action_card.operation_options.is_not_equal_to": "不等于", + "actions.action_card.operation_options.matches_regex": "匹配正则表达式", + "actions.action_card.operator": "运算符", + "actions.action_card.rewrite_rules": "重写规则", + "actions.action_card.then_do": "然后做……", + "actions.action_card.to": "到", + "actions.action_card.translate_into": "翻译成", + "actions.action_card.value": "值", + "actions.action_card.when_feeds_match": "当 Feed 匹配:", + "actions.newRule": "新规则", + "actions.save": "保存", + "actions.saveSuccess": "🎉 指令已保存。", + "actions.sidebar_title": "指令", + "actions.title": "指令", + "appearance.code_highlight_theme": "代码高亮主题", + "appearance.content": "内容", + "appearance.content_font": "内容字体", + "appearance.custom_font": "自定义字体", + "appearance.fonts": "字体", + "appearance.general": "一般的", + "appearance.guess_code_language.description": "使用模型来推断未标记代码块的主要编程语言", + "appearance.guess_code_language.label": "猜测代码语言", + "appearance.misc": "杂项", + "appearance.modal_overlay.description": "显示模态叠加", + "appearance.modal_overlay.label": "显示模态叠加", + "appearance.opaque_sidebars.label": "不透明侧边栏", + "appearance.reader_render_inline_style.description": "允许渲染原始 HTML 的内联样式。", + "appearance.reader_render_inline_style.label": "渲染内联样式", + "appearance.reduce_motion.description": "减少动效以提高性能并降低能耗", + "appearance.reduce_motion.label": "减少动效", + "appearance.save": "保存", + "appearance.show_dock_badge.label": "显示为 Dock 徽章", + "appearance.sidebar_show_unread_count.label": "在侧边栏中显示", + "appearance.sidebar_title": "外观", + "appearance.text_size": "文字大小", + "appearance.theme.dark": "深色", + "appearance.theme.label": "主题", + "appearance.theme.light": "亮色", + "appearance.theme.system": "跟随系统", + "appearance.title": "外观", + "appearance.ui_font": "软件界面字体", + "appearance.unread_count": "未读数", + "general.app": "应用程序", + "general.data_persist.description": "在本地保留数据以启用离线访问和本地搜索。", + "general.data_persist.label": "保留数据以供离线使用", + "general.group_by_date.description": "按日期对条目进行分组。", + "general.group_by_date.label": "按日期分组", + "general.language": "语言", + "general.launch_at_login": "登录时启动", + "general.mark_as_read.hover.description": "悬停时自动将条目标记为已读。", + "general.mark_as_read.hover.label": "悬停时标记为已读", + "general.mark_as_read.render.description": "当单级条目(例如社交媒体帖子、图片、视频视图)进入视图时自动将其标记为已读。", + "general.mark_as_read.render.label": "在视图中标记为已读", + "general.mark_as_read.scroll.description": "当滚动出视图时自动将条目标记为已读。", + "general.mark_as_read.scroll.label": "滚动时标记为已读", + "general.privacy_data": "隐私", + "general.rebuild_database.button": "重建", + "general.rebuild_database.description": "如果您遇到渲染问题,重建数据库可能会解决这些问题。", + "general.rebuild_database.label": "重建数据库", + "general.rebuild_database.title": "重建数据库", + "general.rebuild_database.warning.line1": "重建数据库将清除所有本地数据。", + "general.rebuild_database.warning.line2": "您确定要继续吗?", + "general.rebuild_database.warning[0]": "重建数据库将清除所有本地数据。", + "general.rebuild_database.warning[1]": "您确定要继续吗?", + "general.send_anonymous_data.description": "通过选择发送匿名遥测数据,您可以为改善\"关注\"的整体用户体验做出贡献。", + "general.send_anonymous_data.label": "发送匿名数据", + "general.show_unread_on_launch.description": "启动时显示未读内容", + "general.show_unread_on_launch.label": "启动时显示未读内容", + "general.sidebar_title": "一般的", + "general.timeline": "时间轴", + "general.unread": "未读", + "general.voices": "声音", + "integration.eagle.enable.description": "显示\"将媒体保存到 Eagle\"按钮(如果可用)。", + "integration.eagle.enable.label": "启用", + "integration.eagle.title": "Eagle", + "integration.instapaper.enable.description": "显示\"保存到 Instapaper\"按钮(如果可用)。", + "integration.instapaper.enable.label": "启用", + "integration.instapaper.password.label": "密码", + "integration.instapaper.title": "Instapaper", + "integration.instapaper.username.label": "Instapaper 用户名", + "integration.readwise.enable.description": "显示\"保存到 Readwise\"按钮(如果可用)。", + "integration.readwise.enable.label": "启用", + "integration.readwise.title": "Readwise", + "integration.readwise.token.description": "您可以在这里获取它", + "integration.readwise.token.label": "Readwise 访问令牌", + "integration.sidebar_title": "第三方接入", + "integration.tip": "提示:您的敏感数据存储在本地,不会上传到服务器。", + "integration.title": "第三方接入", + "invitation.activate": "激活", + "invitation.codeOptions.betaUser": "1. 寻找邀请您的测试版用户。", + "invitation.codeOptions.discord": "2. 加入我们的 Discord 服务器,偶尔获得赠品。", + "invitation.codeOptions.xAccount": "3.关注我们的 X 账户,不定期有赠品。", + "invitation.confirmModal.cancel": "取消", + "invitation.confirmModal.confirm": "您想继续吗?", + "invitation.confirmModal.continue": "继续", + "invitation.confirmModal.message": "生成邀请码将花费您 {{INVITATION_PRICE}} Power。", + "invitation.confirmModal.title": "确认", + "invitation.earlyAccess": "Follow 目前处于早期开发状态,需要邀请码才能使用。", + "invitation.earlyAccessMessage": "😰 抱歉,关注目前处于抢先体验阶段,需要邀请码才能使用。", + "invitation.generateButton": "生成邀请码", + "invitation.generateCost": "您可以花费 {{INVITATION_PRICE}} Power 为您的朋友生成邀请码。", + "invitation.getCodeMessage": "您可以通过以下方式获取邀请码:", + "invitation.newInvitationSuccess": "🎉 新邀请已生成,邀请码已复制", + "invitation.noInvitations": "没有邀请", + "invitation.notUsed": "未使用", + "invitation.sidebar_title": "邀请", + "invitation.tableHeaders.code": "代码", + "invitation.tableHeaders.creationTime": "创建时间", + "invitation.tableHeaders.usedBy": "使用者", + "invitation.title": "邀请码", + "profile.avatar.label": "头像", + "profile.handle.description": "您的唯一标识符。", + "profile.handle.label": "Handle", + "profile.name.description": "您的公开显示名称。", + "profile.name.label": "显示名称", + "profile.sidebar_title": "个人资料", + "profile.submit": "提交", + "profile.title": "配置文件设置", + "profile.updateSuccess": "个人资料已更新。", + "titles.about": "关于", + "titles.actions": "指令", + "titles.appearance": "外观", + "titles.general": "常规", + "titles.integration": "集成", + "titles.invitations": "邀请", + "titles.power": "Power", + "titles.profile": "个人资料", + "titles.shortcuts": "快捷键", + "wallet.address.title": "您的地址", + "wallet.balance.title": "您的余额", + "wallet.balance.withdrawable": "可提取", + "wallet.balance.withdrawableTooltip": "可提取的 Power 包括您收到的打赏和充值的 Power。", + "wallet.claim.button.claim": "领取每日 Power", + "wallet.claim.button.claimed": "今日已领取", + "wallet.claim.tooltip.alreadyClaimed": "您今天已经领取过了。", + "wallet.claim.tooltip.canClaim": "立即领取您的 {{amount}} 每日 Power!", + "wallet.create.button": "创建钱包", + "wallet.create.description": "创建一个免费钱包以接收 Power,可用于奖励创作者,也可以因您的内容贡献而获得奖励。", + "wallet.power.dailyClaim": "您每天可以领取 {{amount}} 个免费 Power,可用于在 Follow 上打赏 RSS 条目。", + "wallet.power.description": "Power 是 {{blockchainName}} 区块链上的一种 ERC-20 代币。", + "wallet.sidebar_title": "Power", + "wallet.transactions.amount": "数量", + "wallet.transactions.date": "日期", + "wallet.transactions.from": "发送至", + "wallet.transactions.noTransactions": "无交易记录", + "wallet.transactions.title": "交易记录", + "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.you": "您", + "wallet.withdraw.addressLabel": "您的以太坊地址", + "wallet.withdraw.amountLabel": "数量", + "wallet.withdraw.availableBalance": "您的钱包中有 可提取的 Power。", + "wallet.withdraw.button": "提取", + "wallet.withdraw.error": "提取失败:{{error}}", + "wallet.withdraw.modalTitle": "提取 Power", + "wallet.withdraw.submitButton": "提交", + "wallet.withdraw.success": "提取成功!" +} diff --git a/locales/shortcuts/en.json b/locales/shortcuts/en.json new file mode 100644 index 000000000..0a03f08e0 --- /dev/null +++ b/locales/shortcuts/en.json @@ -0,0 +1,24 @@ +{ + "keys.audio.playPause": "Play/Pause (When the audio player is open)", + "keys.entries.markAllAsRead": "Mark All as Read", + "keys.entries.next": "Next Entry", + "keys.entries.previous": "Previous Entry", + "keys.entries.refetch": "Refetch", + "keys.entries.toggleUnreadOnly": "Toggle Unread Only", + "keys.entry.copyLink": "Copy Link", + "keys.entry.openInBrowser": "Open in Browser", + "keys.entry.openInNewTab": "Open in New Tab", + "keys.entry.scrollDown": "Scroll Down", + "keys.entry.scrollUp": "Scroll Up", + "keys.entry.share": "Share", + "keys.entry.tip": "Tip Power", + "keys.entry.toggleRead": "Toggle Read", + "keys.entry.toggleStarred": "Toggle Starred", + "keys.entry.tts": "Play TTS", + "keys.feeds.add": "Add Subscription", + "keys.feeds.switchBetweenViews": "Switch Between Views", + "keys.feeds.switchToView": "Switch to View", + "keys.layout.showShortcuts": "Show/Hide Shortcuts", + "keys.layout.toggleSidebar": "Show/Hide Feed Sidebar", + "sidebar_title": "Shortcuts" +} diff --git a/locales/shortcuts/zh-CN.json b/locales/shortcuts/zh-CN.json new file mode 100644 index 000000000..25dbb5250 --- /dev/null +++ b/locales/shortcuts/zh-CN.json @@ -0,0 +1,24 @@ +{ + "keys.audio.playPause": "播放/暂停(当音频播放器打开时)", + "keys.entries.markAllAsRead": "全部标记为已读", + "keys.entries.next": "下一个条目", + "keys.entries.previous": "上一个条目", + "keys.entries.refetch": "刷新", + "keys.entries.toggleUnreadOnly": "切换仅未读", + "keys.entry.copyLink": "复制链接", + "keys.entry.openInBrowser": "在浏览器中打开", + "keys.entry.openInNewTab": "在新的标签页中打开", + "keys.entry.scrollDown": "向下滚动", + "keys.entry.scrollUp": "向上滚动", + "keys.entry.share": "分享", + "keys.entry.tip": "打赏", + "keys.entry.toggleRead": "标记为已读/未读", + "keys.entry.toggleStarred": "加入收藏/取消收藏", + "keys.entry.tts": "TTS", + "keys.feeds.add": "添加 Feed", + "keys.feeds.switchBetweenViews": "在视图之间切换", + "keys.feeds.switchToView": "切换到视图", + "keys.layout.showShortcuts": "显示/隐藏快捷键", + "keys.layout.toggleSidebar": "显示/隐藏提要侧边栏", + "sidebar_title": "快捷键" +} diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index 9bce16a9d..f6bac9017 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -10,5 +10,8 @@ export const currentSupportedLanguages = (() => { export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], - zh_CN: ["zh-cn", () => import("dayjs/locale/zh-cn")], + ["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")], } + +export const ns = ["app", "common", "lang", "settings", "shortcuts"] as const +export const defaultNS = "app" as const diff --git a/src/renderer/src/@types/default-resource.ts b/src/renderer/src/@types/default-resource.ts index bec83d526..51ddc8165 100644 --- a/src/renderer/src/@types/default-resource.ts +++ b/src/renderer/src/@types/default-resource.ts @@ -1,8 +1,11 @@ import en from "../../../../locales/app/en.json" import common_en from "../../../../locales/common/en.json" -import common_zhCN from "../../../../locales/common/zh_CN.json" +import common_zhCN from "../../../../locales/common/zh-CN.json" import external_en from "../../../../locales/external/en.json" import lang_en from "../../../../locales/lang/en.json" +import lang_zhCN from "../../../../locales/lang/zh-CN.json" +import settings_en from "../../../../locales/settings/en.json" +import shortcuts_en from "../../../../locales/shortcuts/en.json" /** * This file is the language resource that is loaded in full when the app is initialized. @@ -18,9 +21,11 @@ export const defaultResources = { lang: lang_en, common: common_en, external: external_en, + settings: settings_en, + shortcuts: shortcuts_en, }, - - zh_CN: { + "zh-CN": { + lang: lang_zhCN, common: common_zhCN, }, } diff --git a/src/renderer/src/@types/i18next.d.ts b/src/renderer/src/@types/i18next.d.ts index 1e5c1be34..e8afee158 100644 --- a/src/renderer/src/@types/i18next.d.ts +++ b/src/renderer/src/@types/i18next.d.ts @@ -1,9 +1,12 @@ +import type { defaultNS, ns } from "./constants" import type { defaultResources as resources } from "./default-resource" declare module "i18next" { interface CustomTypeOptions { + // ns: ["app", "common", "external", "lang", "settings", "shortcuts"] + ns: typeof ns resources: (typeof resources)["en"] - defaultNS: "app" + defaultNS: typeof defaultNS // if you see an error like: "Argument of type 'DefaultTFuncReturn' is not assignable to parameter of type xyz" // set returnNull to false (and also in the i18next init options) // returnNull: false; diff --git a/src/renderer/src/components/ui/datetime/index.tsx b/src/renderer/src/components/ui/datetime/index.tsx index 7c941650d..780ca9dec 100644 --- a/src/renderer/src/components/ui/datetime/index.tsx +++ b/src/renderer/src/components/ui/datetime/index.tsx @@ -1,7 +1,9 @@ +import { useGeneralSettingSelector } from "@renderer/atoms/settings/general" import { stopPropagation } from "@renderer/lib/dom" import dayjs from "dayjs" import type { FC } from "react" import { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "../tooltip" @@ -84,6 +86,9 @@ export const RelativeTime: FC<{ } export const RelativeDay = ({ date }: { date: Date }) => { + const { t } = useTranslation("common") + const language = useGeneralSettingSelector((s) => s.language) + const formatDateString = (date: Date) => { const now = new Date() @@ -95,11 +100,11 @@ export const RelativeDay = ({ date }: { date: Date }) => { const diffDays = diffTime / (1000 * 3600 * 24) if (diffDays === 0) { - return "Today" + return t("time.today") } else if (diffDays === 1) { - return "Yesterday" + return t("time.yesterday") } else { - return date.toLocaleDateString("en-US", { + return date.toLocaleDateString(new Intl.Locale(language), { weekday: "long", month: "short", day: "numeric", @@ -121,7 +126,7 @@ export const RelativeDay = ({ date }: { date: Date }) => { return () => { clearTimeout(timerRef.current) } - }, [date]) + }, [date, language]) const formated = dayjs(date).format(formatTemplateString) if (formated === dateString) { diff --git a/src/renderer/src/components/ui/kbd/Kbd.tsx b/src/renderer/src/components/ui/kbd/Kbd.tsx index ae6704f5c..9d9593b5b 100644 --- a/src/renderer/src/components/ui/kbd/Kbd.tsx +++ b/src/renderer/src/components/ui/kbd/Kbd.tsx @@ -175,7 +175,7 @@ export const Kbd: FC<{ children: string; className?: string }> = memo(({ childre } case SharedKeys.backspace: { - return + return } case SpecialKeys.macOS.meta: { return @@ -271,13 +271,14 @@ function MaterialSymbolsSpaceBarRounded(props: React.SVGProps) { ) } -function MaterialSymbolsBackspace(props: React.SVGProps) { + +function MaterialSymbolsBackspaceOutlineSharp(props: React.SVGProps) { return ( + d="M7.95 19L3 12l4.95-7H21v14zM9 17h10V7H9l-3.55 5zm2.4-1l2.6-2.6l2.6 2.6l1.4-1.4l-2.6-2.6L18 9.4L16.6 8L14 10.6L11.4 8L10 9.4l2.6 2.6l-2.6 2.6zm7.6 1V7z" + /> ) } diff --git a/src/renderer/src/components/ui/markdown/components/TimeStamp.tsx b/src/renderer/src/components/ui/markdown/components/TimeStamp.tsx index cfa1818ee..2509d1d25 100644 --- a/src/renderer/src/components/ui/markdown/components/TimeStamp.tsx +++ b/src/renderer/src/components/ui/markdown/components/TimeStamp.tsx @@ -21,7 +21,7 @@ export const TimeStamp = (props: { time: string }) => { nextFrame(() => AudioPlayer.seek(timeStringToSeconds(props.time) || 0)) }} > - + {props.time} ) diff --git a/src/renderer/src/components/user-button.tsx b/src/renderer/src/components/user-button.tsx index 87e7cd9aa..f506bd57d 100644 --- a/src/renderer/src/components/user-button.tsx +++ b/src/renderer/src/components/user-button.tsx @@ -12,6 +12,7 @@ import { useSettingModal } from "@renderer/modules/settings/modal/hooks" import { useSession } from "@renderer/queries/auth" import type { FC } from "react" import { memo } from "react" +import { useTranslation } from "react-i18next" import { Link } from "react-router-dom" import { UserArrowLeftIcon } from "./icons/user" @@ -33,6 +34,7 @@ interface LoginProps { export const LoginButton: FC = (props) => { const { method } = props const modalStack = useModalStack() + const { t } = useTranslation() const Content = ( = (props) => { } : undefined } - tooltip="Login" + tooltip={t("words.login")} > diff --git a/src/renderer/src/components/view-select-content.tsx b/src/renderer/src/components/view-select-content.tsx index 23e4de591..aba1a8b24 100644 --- a/src/renderer/src/components/view-select-content.tsx +++ b/src/renderer/src/components/view-select-content.tsx @@ -1,16 +1,21 @@ import { SelectContent, SelectItem } from "@renderer/components/ui/select" import { views } from "@renderer/constants" import { cn } from "@renderer/lib/utils" +import { useTranslation } from "react-i18next" -export const ViewSelectContent = () => ( - - {views.map((view, index) => ( - -
- {view.icon} - {view.name} -
-
- ))} -
-) +export const ViewSelectContent = () => { + const { t } = useTranslation() + + return ( + + {views.map((view, index) => ( + +
+ {view.icon} + {t(view.name)} +
+
+ ))} +
+ ) +} diff --git a/src/renderer/src/constants/copy.ts b/src/renderer/src/constants/copy.ts index 90d4c621a..460594473 100644 --- a/src/renderer/src/constants/copy.ts +++ b/src/renderer/src/constants/copy.ts @@ -1,4 +1,5 @@ -const OpenInBrowser = (_t?: any) => (window.electron ? "Open in browser" : "Open in new tab") +const OpenInBrowser = (_t?: any) => + window.electron ? "keys.entry.openInBrowser" : "keys.entry.openInNewTab" export const COPY_MAP = { OpenInBrowser, diff --git a/src/renderer/src/constants/shortcuts.ts b/src/renderer/src/constants/shortcuts.ts index 3edc3affd..8df4fee4d 100644 --- a/src/renderer/src/constants/shortcuts.ts +++ b/src/renderer/src/constants/shortcuts.ts @@ -3,57 +3,57 @@ import { COPY_MAP } from "@renderer/constants" export const shortcuts = { feeds: { add: { - name: "Add Subscription", + name: "keys.feeds.add", key: "Meta+T", }, switchToView: { - name: "Switch to View", + name: "keys.feeds.switchToView", key: "1, 2, 3, 4, 5, 6", }, switchBetweenViews: { - name: "Switch Between Views", + name: "keys.feeds.switchBetweenViews", key: "Tab, Left, Right", }, }, layout: { toggleSidebar: { - name: "Show/Hide Feed Sidebar", + name: "keys.layout.toggleSidebar", key: "Meta+B", }, showShortcuts: { - name: "Show Shortcuts", + name: "keys.layout.showShortcuts", key: "H", }, }, entries: { refetch: { - name: "Refetch", + name: "keys.entries.refetch", key: "R", }, previous: { - name: "Previous Entry", + name: "keys.entries.previous", key: "K, Up", }, next: { - name: "Next Entry", + name: "keys.entries.next", key: "J, Down", }, markAllAsRead: { - name: "Mark All as Read", + name: "keys.entries.markAllAsRead", key: "Shift+Meta+A", }, toggleUnreadOnly: { - name: "Toggle Unread Only", + name: "keys.entries.toggleUnreadOnly", key: "U", }, }, entry: { toggleRead: { - name: "Toggle Read", + name: "keys.entry.toggleRead", key: "M", }, toggleStarred: { - name: "Toggle Starred", + name: "keys.entry.toggleStarred", key: "S", }, openInBrowser: { @@ -62,34 +62,33 @@ export const shortcuts = { extra: "Double Click", }, tts: { - name: "Play TTS", + name: "keys.entry.tts", key: "Shift+Meta+V", }, copyLink: { - name: "Copy Link", + name: "keys.entry.copyLink", key: "Shift+Meta+C", }, tip: { - name: "Tip Power", + name: "keys.entry.tip", key: "Shift+Meta+T", }, share: { - name: "Share", + name: "keys.entry.share", key: "Meta+Alt+S", }, scrollUp: { - name: "Scroll Up", + name: "keys.entry.scrollUp", key: "PageUp", }, scrollDown: { - name: "Scroll Down", + name: "keys.entry.scrollDown", key: "PageDown", }, }, - audio: { "play/pause": { - name: "Play/Pause (When the audio player is open)", + name: "keys.audio.playPause", key: "Space", }, }, diff --git a/src/renderer/src/constants/tabs.tsx b/src/renderer/src/constants/tabs.tsx index a280867a1..5c0c4fc8b 100644 --- a/src/renderer/src/constants/tabs.tsx +++ b/src/renderer/src/constants/tabs.tsx @@ -1,8 +1,19 @@ import { FeedViewType } from "@renderer/lib/enum" +import type React from "react" -export const views = [ +interface ViewDefinition { + name: I18nKeys + icon: React.JSX.Element + className: string + peerClassName: string + translation: string + view: FeedViewType + wideMode?: boolean + gridMode?: boolean +} +export const views: ViewDefinition[] = [ { - name: "Articles", + name: "feed_view_type.articles", icon: , className: "text-accent", peerClassName: "peer-checked:text-accent", @@ -10,7 +21,7 @@ export const views = [ view: FeedViewType.Articles, }, { - name: "Social Media", + name: "feed_view_type.social_media", icon: , className: "text-sky-600 dark:text-sky-500", peerClassName: "peer-checked:text-sky-600 peer-checked:dark:text-sky-500", @@ -19,7 +30,7 @@ export const views = [ view: FeedViewType.SocialMedia, }, { - name: "Pictures", + name: "feed_view_type.pictures", icon: , className: "text-green-600 dark:text-green-500", peerClassName: "peer-checked:text-green-600 peer-checked:dark:text-green-500", @@ -29,7 +40,7 @@ export const views = [ view: FeedViewType.Pictures, }, { - name: "Videos", + name: "feed_view_type.videos", icon: , className: "text-red-600 dark:text-red-500", peerClassName: "peer-checked:text-red-600 peer-checked:dark:text-red-500", @@ -39,7 +50,7 @@ export const views = [ view: FeedViewType.Videos, }, { - name: "Audios", + name: "feed_view_type.audios", icon: , className: "text-purple-600 dark:text-purple-500", peerClassName: "peer-checked:text-purple-600 peer-checked:dark:text-purple-500", @@ -47,7 +58,7 @@ export const views = [ view: FeedViewType.Audios, }, { - name: "Notifications", + name: "feed_view_type.notifications", icon: , className: "text-yellow-600 dark:text-yellow-500", peerClassName: "peer-checked:text-yellow-600 peer-checked:dark:text-yellow-500", diff --git a/src/renderer/src/global.d.ts b/src/renderer/src/global.d.ts index ac3a35caf..5f7b127b1 100644 --- a/src/renderer/src/global.d.ts +++ b/src/renderer/src/global.d.ts @@ -1,6 +1,9 @@ -import type { t } from "i18next" import type { FC, PropsWithChildren } from "react" - +import type { useTranslation } from "react-i18next" +// eslint-disable-next-line react-hooks/rules-of-hooks, unused-imports/no-unused-vars +const { t } = useTranslation() +// eslint-disable-next-line react-hooks/rules-of-hooks, unused-imports/no-unused-vars +const { t: settingsT } = useTranslation("settings") declare global { export type Component

= FC @@ -28,9 +31,13 @@ declare global { WINDOW_UNDER_BLUR: boolean } + /** + * This function is a macro, will replace in the build stage. + */ export function tw(strings: TemplateStringsArray, ...values: any[]): string export type I18nKeys = OmitStringType[0]> + export type I18nKeysForSettings = OmitStringType[0]> type IsLiteralString = T extends string ? (string extends T ? never : T) : never diff --git a/src/renderer/src/hooks/biz/useEntryActions.tsx b/src/renderer/src/hooks/biz/useEntryActions.tsx index d8b4e269a..5857954c6 100644 --- a/src/renderer/src/hooks/biz/useEntryActions.tsx +++ b/src/renderer/src/hooks/biz/useEntryActions.tsx @@ -11,7 +11,6 @@ import { SimpleIconsInstapaper, SimpleIconsReadwise, } from "@renderer/components/ui/platform-icon/icons" -import { COPY_MAP } from "@renderer/constants" import { shortcuts } from "@renderer/constants/shortcuts" import { tipcClient } from "@renderer/lib/client" import { nextFrame } from "@renderer/lib/dom" @@ -26,6 +25,7 @@ import type { FetchError } from "ofetch" import { ofetch } from "ofetch" import type { ReactNode } from "react" import { useCallback, useMemo } from "react" +import { useTranslation } from "react-i18next" import { toast } from "sonner" export const useEntryReadabilityToggle = ({ id, url }: { id: string; url: string }) => @@ -104,6 +104,8 @@ export const useEntryActions = ({ entry?: FlatEntryModel | null type?: "toolbar" | "entryList" }) => { + const { t } = useTranslation() + const checkEagle = useQuery({ queryKey: ["check-eagle"], enabled: !!entry?.entries.url && view !== undefined, @@ -161,7 +163,7 @@ export const useEntryActions = ({ onClick: () => void }[] = [ { - name: "Save media to Eagle", + name: t("entry_actions.save_media_to_eagle"), icon: , key: "saveToEagle", hide: @@ -188,7 +190,7 @@ export const useEntryActions = ({ }, }, { - name: "Save to Readwise", + name: t("entry_actions.save_to_readwise"), icon: , key: "saveToReadwise", hide: !enableReadwise || !readwiseToken || !populatedEntry.entries.url, @@ -229,7 +231,7 @@ export const useEntryActions = ({ }, }, { - name: "Save to Instapaper", + name: t("entry_actions.save_to_instapaper"), icon: , key: "saveToInstapaper", hide: @@ -275,7 +277,7 @@ export const useEntryActions = ({ { key: "tip", shortcut: shortcuts.entry.tip.key, - name: `Tip`, + name: t("entry_actions.tip"), className: "i-mgc-power-outline", hide: feed?.ownerUserId === whoami()?.id, onClick: () => { @@ -285,7 +287,7 @@ export const useEntryActions = ({ { key: "star", shortcut: shortcuts.entry.toggleStarred.key, - name: `Star`, + name: t("entry_actions.star"), className: "i-mgc-star-cute-re", hide: !!populatedEntry.collections, onClick: () => { @@ -294,7 +296,7 @@ export const useEntryActions = ({ }, { key: "unstar", - name: `Unstar`, + name: t("entry_actions.unstar"), shortcut: shortcuts.entry.toggleStarred.key, className: "i-mgc-star-cute-fi text-orange-500", hide: !populatedEntry.collections, @@ -304,7 +306,7 @@ export const useEntryActions = ({ }, { key: "copyLink", - name: "Copy link", + name: t("entry_actions.copy_link"), className: "i-mgc-link-cute-re", hide: !populatedEntry.entries.url, shortcut: shortcuts.entry.copyLink.key, @@ -318,7 +320,7 @@ export const useEntryActions = ({ }, { key: "openInBrowser", - name: COPY_MAP.OpenInBrowser(), + name: t("entry_actions.open_in_browser"), shortcut: shortcuts.entry.openInBrowser.key, className: "i-mgc-world-2-cute-re", hide: !populatedEntry.entries.url, @@ -328,7 +330,7 @@ export const useEntryActions = ({ }, }, { - name: "Share", + name: t("entry_actions.share"), key: "share", className: getOS() === "macOS" ? `i-mgc-share-3-cute-re` : "i-mgc-share-forward-cute-re", shortcut: shortcuts.entry.share.key, @@ -349,7 +351,7 @@ export const useEntryActions = ({ }, { key: "read", - name: `Mark as read`, + name: t("entry_actions.mark_as_read"), shortcut: shortcuts.entry.toggleRead.key, className: "i-mgc-round-cute-fi", hide: !!(!!populatedEntry.read || populatedEntry.collections), @@ -359,7 +361,7 @@ export const useEntryActions = ({ }, { key: "unread", - name: `Mark as unread`, + name: t("entry_actions.mark_as_unread"), shortcut: shortcuts.entry.toggleRead.key, className: "i-mgc-round-cute-re", hide: !!(!populatedEntry.read || populatedEntry.collections), @@ -381,6 +383,7 @@ export const useEntryActions = ({ read, unread, feed?.ownerUserId, + t, ]) return { diff --git a/src/renderer/src/hooks/biz/useFeedActions.tsx b/src/renderer/src/hooks/biz/useFeedActions.tsx index a9a37e3ca..5051141a6 100644 --- a/src/renderer/src/hooks/biz/useFeedActions.tsx +++ b/src/renderer/src/hooks/biz/useFeedActions.tsx @@ -7,6 +7,7 @@ import { getFeedById, useFeedById } from "@renderer/store/feed" import { subscriptionActions, useSubscriptionByFeedId } from "@renderer/store/subscription" import { WEB_URL } from "@shared/constants" import { useMemo } from "react" +import { useTranslation } from "react-i18next" import { useNavigateEntry } from "./useNavigateEntry" import { getRouteParams } from "./useRouteParams" @@ -21,6 +22,7 @@ export const useFeedActions = ({ view?: number type?: "feedList" | "entryList" }) => { + const { t } = useTranslation() const feed = useFeedById(feedId) const subscription = useSubscriptionByFeedId(feedId) @@ -38,24 +40,26 @@ export const useFeedActions = ({ const items: NativeMenuItem[] = [ { type: "text" as const, - label: isEntryList ? "Edit feed" : "Edit", + label: isEntryList ? t("sidebar.feed_actions.edit_feed") : t("sidebar.feed_actions.edit"), shortcut: "E", click: () => { present({ - title: "Edit Feed", + title: t("sidebar.feed_actions.edit_feed"), content: ({ dismiss }) => , }) }, }, { type: "text" as const, - label: isEntryList ? "Unfollow feed" : "Unfollow", + label: isEntryList + ? t("sidebar.feed_actions.unfollow_feed") + : t("sidebar.feed_actions.unfollow"), shortcut: "Meta+Backspace", click: () => deleteSubscription.mutate(subscription), }, { type: "text" as const, - label: "Navigate to feed", + label: t("sidebar.feed_actions.navigate_to_feed"), shortcut: "Meta+G", disabled: !isEntryList || getRouteParams().feedId === feedId, click: () => { @@ -68,7 +72,7 @@ export const useFeedActions = ({ }, { type: "text", - label: "Mark all as read", + label: t("sidebar.feed_actions.mark_all_as_read"), shortcut: "Meta+Shift+A", disabled: isEntryList, click: () => subscriptionActions.markReadByFeedIds([feedId]), @@ -77,7 +81,9 @@ export const useFeedActions = ({ ? [ { type: "text" as const, - label: isEntryList ? "Claim Feed" : "Claim", + label: isEntryList + ? t("sidebar.feed_actions.claim_feed") + : t("sidebar.feed_actions.claim"), shortcut: "C", click: () => { claimFeed() @@ -89,7 +95,7 @@ export const useFeedActions = ({ ? [ { type: "text" as const, - label: "This feed is owned by you", + label: t("sidebar.feed_actions.feed_owned_by_you"), }, ] : []), @@ -97,17 +103,16 @@ export const useFeedActions = ({ type: "separator" as const, disabled: isEntryList, }, - { type: "text" as const, - label: "Open feed in browser", + label: t("sidebar.feed_actions.open_feed_in_browser"), disabled: isEntryList, shortcut: "O", click: () => window.open(`${WEB_URL}/feed/${feedId}?view=${view}`, "_blank"), }, { type: "text" as const, - label: "Open site in browser", + label: t("sidebar.feed_actions.open_site_in_browser"), shortcut: "Meta+O", disabled: isEntryList, click: () => { @@ -123,14 +128,14 @@ export const useFeedActions = ({ }, { type: "text" as const, - label: "Copy feed URL", + label: t("sidebar.feed_actions.copy_feed_url"), disabled: isEntryList, shortcut: "Meta+C", click: () => navigator.clipboard.writeText(feed.url), }, { type: "text" as const, - label: "Copy feed ID", + label: t("sidebar.feed_actions.copy_feed_id"), shortcut: "Meta+Shift+C", disabled: isEntryList, click: () => { @@ -141,6 +146,7 @@ export const useFeedActions = ({ return items }, [ + t, claimFeed, deleteSubscription, feed, diff --git a/src/renderer/src/i18n.ts b/src/renderer/src/i18n.ts index 9a352efc6..99c280b7b 100644 --- a/src/renderer/src/i18n.ts +++ b/src/renderer/src/i18n.ts @@ -1,60 +1,58 @@ import { EventBus } from "@renderer/lib/event-bus" -import dayjs from "dayjs" import i18next from "i18next" -import LanguageDetector from "i18next-browser-languagedetector" import { atom } from "jotai" import { initReactI18next } from "react-i18next" +import { defaultNS, ns } from "./@types/constants" import { defaultResources } from "./@types/default-resource" import { jotaiStore } from "./lib/jotai" export const i18nAtom = atom(i18next) -export const defaultNS = "app" - export const fallbackLanguage = "en" export const initI18n = async () => { const i18next = jotaiStore.get(i18nAtom) - await i18next - .use(initReactI18next) - .use(LanguageDetector) - .init({ - lng: "en", + await i18next.use(initReactI18next).init({ + ns, + lng: "en", + fallbackLng: fallbackLanguage, + defaultNS, + debug: import.meta.env.DEV, - fallbackLng: fallbackLanguage, - defaultNS, - debug: import.meta.env.DEV, - resources: defaultResources, - }) - - dayjs.locale("en") + resources: defaultResources, + }) } if (import.meta.hot) { - import.meta.hot.on("i18n-update", ({ file, content }: { file: string; content: string }) => { - const resources = JSON.parse(content) - const i18next = jotaiStore.get(i18nAtom) - // `file` is absolute path e.g. /Users/innei/git/follow/locales/en.json - // Absolute path e.g. /Users/innei/git/follow/locales//en.json + import.meta.hot.on( + "i18n-update", + async ({ file, content }: { file: string; content: string }) => { + const resources = JSON.parse(content) + const i18next = jotaiStore.get(i18nAtom) + // `file` is absolute path e.g. /Users/innei/git/follow/locales/en.json + // Absolute path e.g. /Users/innei/git/follow/locales//en.json - // 1. parse root language - if (!file.includes("locales/namespaces")) { - const lang = file.split("/").pop()?.replace(".json", "") - if (!lang) return - i18next.addResourceBundle(lang, defaultNS, resources, true, true) - i18next.reloadResources(lang, defaultNS) - } else { - const nsName = file.match(/locales\/namespaces\/(.+?)\//)?.[1] + // 1. parse root language + // if (!file.includes("locales/namespaces")) { + // const lang = file.split("/").pop()?.replace(".json", "") + // if (!lang) return + // i18next.addResourceBundle(lang, defaultNS, resources, true, true) + // i18next.reloadResources(lang, defaultNS) + // } else { + const nsName = file.match(/locales\/(.+?)\//)?.[1] if (!nsName) return const lang = file.split("/").pop()?.replace(".json", "") if (!lang) return i18next.addResourceBundle(lang, nsName, resources, true, true) - i18next.reloadResources(lang, nsName) - } - import.meta.env.DEV && EventBus.dispatch("I18N_UPDATE", "") - }) + console.info("reload", lang, nsName) + await i18next.reloadResources(lang, nsName) + // } + + import.meta.env.DEV && EventBus.dispatch("I18N_UPDATE", "") + }, + ) } declare module "@renderer/lib/event-bus" { @@ -62,7 +60,3 @@ declare module "@renderer/lib/event-bus" { I18N_UPDATE: string } } - -export { currentSupportedLanguages } from "./@types/constants" - -window["i18next"] = i18next diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index b6512e914..6d18efd77 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -23,6 +23,6 @@ if (window.electron && getOS() === "Windows") { ReactDOM.createRoot($container).render( - + , ) diff --git a/src/renderer/src/modules/ai/ai-daily/daily.tsx b/src/renderer/src/modules/ai/ai-daily/daily.tsx index bba198adf..cc409d59b 100644 --- a/src/renderer/src/modules/ai/ai-daily/daily.tsx +++ b/src/renderer/src/modules/ai/ai-daily/daily.tsx @@ -35,6 +35,7 @@ import { useFeedById } from "@renderer/store/feed" import { m, useAnimationControls } from "framer-motion" import type { Components } from "hast-util-to-jsx-runtime" import { useEffect, useState } from "react" +import { Trans, useTranslation } from "react-i18next" import { useParseDailyDate } from "./hooks" import type { DailyItemProps, DailyView } from "./types" @@ -60,41 +61,52 @@ export const DailyReportTitle = ({ title: string startDate: number endDate: number -}) => ( -

- -
Top News - {title}
- - - - - - -
    -
  • - Here is news selected by AI from your timeline - {" ("} - {new Date(startDate).toLocaleTimeString("en-US", { - weekday: "short", - hour: "numeric", - minute: "numeric", - })}{" "} - -{" "} - {new Date(endDate + 1).toLocaleTimeString("en-US", { - weekday: "short", - hour: "numeric", - minute: "numeric", - })} - {") "} - that may be important to you. -
  • -
  • Update daily at 8 AM and 8 PM.
  • -
-
-
-
-
-) +}) => { + const { t } = useTranslation() + return ( +
+ +
{t("ai_daily.title", { title })}
+ + + + + + +
    +
  • + + {new Date(startDate).toLocaleTimeString("en-US", { + weekday: "short", + hour: "numeric", + minute: "numeric", + })} + + ), + To: ( + + {new Date(endDate + 1).toLocaleTimeString("en-US", { + weekday: "short", + hour: "numeric", + minute: "numeric", + })} + + ), + }} + /> +
  • +
  • {t("ai_daily.tooltip.update_schedule")}
  • +
+
+
+
+
+ ) +} const useQueryData = ({ endDate, diff --git a/src/renderer/src/modules/ai/ai-daily/hooks.tsx b/src/renderer/src/modules/ai/ai-daily/hooks.tsx index 034904f92..3262261c0 100644 --- a/src/renderer/src/modules/ai/ai-daily/hooks.tsx +++ b/src/renderer/src/modules/ai/ai-daily/hooks.tsx @@ -1,11 +1,14 @@ import { useModalStack } from "@renderer/components/ui/modal" import { useCallback, useMemo } from "react" +import { useTranslation } from "react-i18next" import { DayOf } from "./constants" import { FeedDailyModalContent } from "./FeedDailyModalContent" -export const useParseDailyDate = (day: DayOf) => - useMemo(() => { +export const useParseDailyDate = (day: DayOf) => { + const { t } = useTranslation("common") + + return useMemo(() => { const dateObj = new Date() const nowHour = dateObj.getHours() @@ -27,36 +30,37 @@ export const useParseDailyDate = (day: DayOf) => if (isToday) { endDate = today8PM - 1 startDate = today8AM - title = "Today" + title = t("time.today") } else { endDate = today8AM - 1 startDate = yesterday8PM - title = "Last Night" + title = t("time.last_night") } } else if (nowHour >= 8) { if (isToday) { endDate = today8AM - 1 startDate = yesterday8PM - title = "Last Night" + title = t("time.last_night") } else { endDate = yesterday8PM - 1 startDate = yesterday8AM - title = "Yesterday" + title = t("time.yesterday") } } else { if (isToday) { endDate = yesterday8PM - 1 startDate = yesterday8AM - title = "Yesterday" + title = t("time.yesterday") } else { endDate = yesterday8AM - 1 startDate = dayBeforeYesterday8PM - title = "The Night Before Last" + title = t("time.the_night_before_last") } } return { title, startDate, endDate } - }, [day]) + }, [day, t]) +} export const useAIDailyReportModal = () => { const { present } = useModalStack() diff --git a/src/renderer/src/modules/discover/DiscoverFeedForm.tsx b/src/renderer/src/modules/discover/DiscoverFeedForm.tsx index 804bc9fa2..264626989 100644 --- a/src/renderer/src/modules/discover/DiscoverFeedForm.tsx +++ b/src/renderer/src/modules/discover/DiscoverFeedForm.tsx @@ -26,6 +26,7 @@ import type { FC } from "react" import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react" import type { UseFormReturn } from "react-hook-form" import { useForm } from "react-hook-form" +import { Trans, useTranslation } from "react-i18next" import { toast } from "sonner" import { z } from "zod" @@ -40,36 +41,40 @@ const FeedMaintainers = ({ maintainers }: { maintainers?: string[] }) => { return (
) } const FeedDescription = ({ description }: { description?: string }) => { + const { t } = useTranslation() if (!description) { return null } return ( <> -

- The description of this feed is as follows, and you can fill out the parameter form with the - relevant information. -

+

{t("discover.feed_description")}

{description} @@ -88,6 +93,7 @@ export const DiscoverFeedForm = ({ noDescription?: boolean submitButtonClassName?: string }) => { + const { t } = useTranslation() const keys = useMemo( () => parseRegexpPathParams(route.path, { @@ -207,13 +213,13 @@ export const DiscoverFeedForm = ({ > {/* Select focused ref on `SelectTrigger` or `Select` */} - + {parameters.options.map((option) => ( {option.label} - {parameters.default === option.value && " (default)"} + {parameters.default === option.value && t("discover.default_option")} ))} @@ -246,7 +252,7 @@ export const DiscoverFeedForm = ({ submitButtonClassName, )} > - + diff --git a/src/renderer/src/modules/discover/feed-form.tsx b/src/renderer/src/modules/discover/feed-form.tsx index 156d31ee0..8be17e6b4 100644 --- a/src/renderer/src/modules/discover/feed-form.tsx +++ b/src/renderer/src/modules/discover/feed-form.tsx @@ -34,6 +34,7 @@ import { feedUnreadActions } from "@renderer/store/unread" import { useMutation } from "@tanstack/react-query" import { useEffect, useRef } from "react" import { useForm } from "react-hook-form" +import { useTranslation } from "react-i18next" import { toast } from "sonner" import { z } from "zod" @@ -67,6 +68,8 @@ export const FeedForm: Component<{ const hasSub = useSubscriptionByFeedId(feed?.id || "") const isSubscribed = !!feedQuery.data?.subscription || hasSub + const { t } = useTranslation() + return (
- {isSubscribed ? "Update" : "Add"} follow + {isSubscribed ? t("feed_form.update_follow") : t("feed_form.add_follow")}
)} @@ -90,7 +93,7 @@ export const FeedForm: Component<{ ) : feedQuery.error ? (
-

Error in fetching feed.

+

{t("feed_form.error_fetching_feed")}

{getFetchErrorMessage(feedQuery.error)}

@@ -102,7 +105,7 @@ export const FeedForm: Component<{ feedQuery.refetch() }} > - Retry + {t("feed_form.retry")}
) : (
-

Feed not found.

+

{t("feed_form.feed_not_found")}

{url}

)} @@ -214,7 +217,7 @@ const FeedInnerForm = ({ feedQuery.byId({ id: feedId }).invalidate() tipcClient?.invalidateQuery(feedQuery.byId({ id: feedId }).key) } - toast(isSubscribed ? "🎉 Updated." : "🎉 Followed.", { + toast(isSubscribed ? t("feed_form.updated") : t("feed_form.followed"), { duration: 1000, }) @@ -243,6 +246,8 @@ const FeedInnerForm = ({ followMutation.mutate(values) } + const { t } = useTranslation() + const categories = useAuthQuery(subscriptionQuery.categories(Number.parseInt(form.watch("view")))) // useEffect(() => { @@ -263,7 +268,7 @@ const FeedInnerForm = ({ name="view" render={() => ( - View + {t("feed_form.view")} {views.map((view) => ( @@ -283,7 +288,7 @@ const FeedInnerForm = ({ )} > {view.icon} - {view.name} + {t(view.name)} ))} @@ -299,10 +304,8 @@ const FeedInnerForm = ({ render={({ field }) => (
- Tile - - Custom title for this Feed. Leave empty to use the default. - + {t("feed_form.title")} + {t("feed_form.title_description")}
@@ -317,10 +320,8 @@ const FeedInnerForm = ({ render={({ field }) => (
- Category - - By default, your follows will be grouped by website. - + {t("feed_form.category")} + {t("feed_form.category_description")}
@@ -351,10 +352,8 @@ const FeedInnerForm = ({
- Private Follow - - Whether this follow is publicly visible on your profile page. - + {t("feed_form.private_follow")} + {t("feed_form.private_follow_description")}
- Unfollow + {t("feed_form.unfollow")} )}
diff --git a/src/renderer/src/modules/discover/form.tsx b/src/renderer/src/modules/discover/form.tsx index 0715d7ed1..ca2c1a618 100644 --- a/src/renderer/src/modules/discover/form.tsx +++ b/src/renderer/src/modules/discover/form.tsx @@ -18,6 +18,7 @@ import type { FeedViewType } from "@renderer/lib/enum" import { useMutation } from "@tanstack/react-query" import { useEffect } from "react" import { useForm } from "react-hook-form" +import { useTranslation } from "react-i18next" import { z } from "zod" import { FollowSummary } from "../../components/feed-summary" @@ -30,23 +31,23 @@ const formSchema = z.object({ const info: Record< string, { - label: string + label: I18nKeys prefix?: string[] showModal?: boolean default?: string } > = { search: { - label: "Any URL or Keyword", + label: "discover.any_url_or_keyword", }, rss: { - label: "RSS URL", + label: "discover.rss_url", default: "https://", prefix: ["https://", "http://"], showModal: true, }, rsshub: { - label: "RSSHub Route", + label: "discover.rss_hub_route", prefix: ["rsshub://"], default: "rsshub://", showModal: true, @@ -61,6 +62,7 @@ export function DiscoverForm({ type }: { type: string }) { keyword: defaultValue || "", }, }) + const { t } = useTranslation() const mutation = useMutation({ mutationFn: async (keyword: string) => { const { data } = await apiClient.discover.$post({ @@ -120,7 +122,7 @@ export function DiscoverForm({ type }: { type: string }) { name="keyword" render={({ field }) => ( - {info[type]?.label} + {t(info[type]?.label)} @@ -130,7 +132,7 @@ export function DiscoverForm({ type }: { type: string }) { />
diff --git a/src/renderer/src/modules/discover/import.tsx b/src/renderer/src/modules/discover/import.tsx index b90ccf0b6..1781b41f5 100644 --- a/src/renderer/src/modules/discover/import.tsx +++ b/src/renderer/src/modules/discover/import.tsx @@ -18,6 +18,7 @@ import { Queries } from "@renderer/queries" import { useMutation } from "@tanstack/react-query" import { Fragment } from "react/jsx-runtime" import { useForm } from "react-hook-form" +import { useTranslation } from "react-i18next" import { z } from "zod" import { FollowSummary } from "../../components/feed-summary" @@ -87,6 +88,7 @@ export function DiscoverImport() { function onSubmit(values: z.infer) { mutation.mutate(values.file) } + const { t } = useTranslation() return ( <> @@ -113,7 +115,9 @@ export function DiscoverImport() { - Click to upload OPML file + + {t("discover.import.click_to_upload")} + )} @@ -136,7 +140,7 @@ export function DiscoverImport() { disabled={!form.formState.dirtyFields.file} isLoading={mutation.isPending} > - Import + {t("words.import")}
diff --git a/src/renderer/src/modules/discover/recommendations.tsx b/src/renderer/src/modules/discover/recommendations.tsx index 0bbe35b7a..78c9be230 100644 --- a/src/renderer/src/modules/discover/recommendations.tsx +++ b/src/renderer/src/modules/discover/recommendations.tsx @@ -2,6 +2,7 @@ import { useAuthQuery } from "@renderer/hooks/common" import { isASCII } from "@renderer/lib/utils" import { Queries } from "@renderer/queries" import { useMemo } from "react" +import { useTranslation } from "react-i18next" import { RecommendationCard } from "./recommendations-card" @@ -44,6 +45,7 @@ export function Recommendations() { } }, [data]) + const { t } = useTranslation() if (rsshubPopular.isLoading) { return null } @@ -54,7 +56,7 @@ export function Recommendations() { return (
-
Popular
+
{t("discover.popular")}
{keys.map((key) => ( diff --git a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx index 8ae0fcd03..e2119ade9 100644 --- a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx +++ b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx @@ -10,6 +10,7 @@ import { AnimatePresence, m } from "framer-motion" import type { FC, ReactNode } from "react" import { forwardRef, Fragment, useState } from "react" import { useHotkeys } from "react-hotkeys-hook" +import { Trans, useTranslation } from "react-i18next" import { toast } from "sonner" import { useOnClickOutside } from "usehooks-ts" @@ -30,6 +31,9 @@ export const MarkAllReadWithOverlay = forwardRef< containerRef: React.RefObject } >(({ filter, className, which = "all", shortcut, containerRef }, ref) => { + const { t } = useTranslation() + const { t: commonT } = useTranslation("common") + const [show, setShow] = useState(false) const handleMarkAllAsRead = useMarkAllByRoute(filter) @@ -61,11 +65,12 @@ export const MarkAllReadWithOverlay = forwardRef< - Mark - - {which} - - as read? +
@@ -76,7 +81,7 @@ export const MarkAllReadWithOverlay = forwardRef< setShow(false) }} > - Confirm + {t("words.confirm")}
@@ -125,13 +130,14 @@ export const MarkAllReadWithOverlay = forwardRef< - - Mark - - {which} - - as read - + {shortcut && (
@@ -156,14 +162,15 @@ export const MarkAllReadWithOverlay = forwardRef< }) const ConfirmMarkAllReadInfo = ({ undo }: { undo: () => any }) => { + const { t } = useTranslation() useHotkeys("ctrl+z,meta+z", undo, { scopes: HotKeyScopeMap.Home, preventDefault: true, }) return (
-

Confirm mark all as read?

- Will confirmed automatically after 3s. +

{t("mark_all_read_button.confirm_mark_all_info")}

+ {t("mark_all_read_button.auto_confirm_info")}
) } @@ -200,11 +207,14 @@ export const MarkAllReadPopover = forwardRef
- Mark - - {which} - - as read? +
= (props) => { + const { t } = useTranslation() + const { t: commonT } = useTranslation("common") const { className, filter, which } = props const [status, setStatus] = useState<"initial" | "confirm" | "done">("initial") const handleMarkAll = useMarkAllByRoute(filter) @@ -263,8 +275,14 @@ export const FlatMarkAllReadButton: FC = (props) => { )} - Mark - {which} as read + = (props) => { "duration-200", )} > - Confirm? + {t("mark_all_read_button.confirm")} ) diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 8c4382b2b..3e403c08d 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -19,6 +19,7 @@ import { entryActions, useEntry } from "@renderer/store/entry" import { useFeedByIdSelector } from "@renderer/store/feed" import { useSubscriptionByFeedId } from "@renderer/store/subscription" import { memo, useCallback, useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import type { ScrollSeekConfiguration, VirtuosoGridProps, @@ -39,6 +40,7 @@ const scrollSeekConfiguration: ScrollSeekConfiguration = { exit: (velocity) => Math.abs(velocity) < 1000, } function EntryColumnImpl() { + const { t } = useTranslation() const virtuosoRef = useRef(null) const [isArchived, setIsArchived] = useState(false) const unreadOnly = useGeneralSettingKey("unreadOnly") @@ -104,7 +106,7 @@ function EntryColumnImpl() { return (
) @@ -185,7 +187,7 @@ function EntryColumnImpl() { {isRefreshing && (
- Refreshing new entries... + {t("entry_column.refreshing")}
)} diff --git a/src/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx b/src/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx index e9b347ebf..65bc378a2 100644 --- a/src/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx +++ b/src/renderer/src/modules/entry-column/layouts/EntryItemWrapper.tsx @@ -11,6 +11,7 @@ import type { FlatEntryModel } from "@renderer/store/entry" import { entryActions } from "@renderer/store/entry" import type { FC, PropsWithChildren } from "react" import { useCallback } from "react" +import { useTranslation } from "react-i18next" import { useDebounceCallback } from "usehooks-ts" export const EntryItemWrapper: FC< @@ -33,6 +34,8 @@ export const EntryItemWrapper: FC< type: "entryList", }) + const { t } = useTranslation("common") + const isActive = useRouteParamsSelector(({ entryId }) => entryId === entry.entries.id) const asRead = useAsRead(entry) @@ -91,7 +94,7 @@ export const EntryItemWrapper: FC< }, { type: "text" as const, - label: "Copy Entry ID", + label: `${t("words.copy")}${t("words.space")}${t("words.entry")} ${t("words.id")}`, click: () => { navigator.clipboard.writeText(entry.entries.id) }, @@ -100,7 +103,7 @@ export const EntryItemWrapper: FC< e, ) }, - [items, feedItems, entry.entries.id], + [items, feedItems, t, entry.entries.id], ) return ( diff --git a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx index 957302410..d486e657b 100644 --- a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx +++ b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx @@ -17,6 +17,7 @@ import { useRefreshFeedMutation } from "@renderer/queries/feed" import { useFeedById, useFeedHeaderTitle } from "@renderer/store/feed" import type { FC } from "react" import * as React from "react" +import { useTranslation } from "react-i18next" import { MarkAllReadWithOverlay } from "../components/mark-all-button" @@ -27,6 +28,7 @@ export const EntryListHeader: FC<{ hasUpdate: boolean }> = ({ totalCount, refetch, isRefreshing, hasUpdate }) => { const routerParams = useRouteParms() + const { t } = useTranslation() const unreadOnly = useGeneralSettingKey("unreadOnly") @@ -46,7 +48,10 @@ export const EntryListHeader: FC<{
- {totalCount || 0} {unreadOnly && !isInCollectionList ? "Unread" : ""} Items + {totalCount || 0} {t("quantifier.piece", { ns: "common" })} + {unreadOnly && !isInCollectionList ? t("words.unread") : ""} + {t("words.space", { ns: "common" })} + {t("words.items", { ns: "common", count: totalCount })}
) @@ -64,7 +69,10 @@ export const EntryListHeader: FC<{ return (
{!titleAtBottom && titleInfo} @@ -102,7 +110,11 @@ export const EntryListHeader: FC<{ ) : ( { refetch() }} @@ -118,7 +130,11 @@ export const EntryListHeader: FC<{ ) ) : null} setGeneralSetting("unreadOnly", !unreadOnly)} > @@ -138,6 +154,8 @@ export const EntryListHeader: FC<{ const DailyReportButton: FC = () => { const present = useAIDailyReportModal() + const { t } = useTranslation() + return ( { click: 1, }) }} - tooltip="Daily Report" + tooltip={t("entry_list_header.daily_report")} > @@ -157,6 +175,8 @@ const DailyReportButton: FC = () => { const SwitchToMasonryButton = () => { const isMasonry = useUISettingKey("pictureViewMasonry") + const { t } = useTranslation() + return ( { click: 1, }) }} - tooltip={`Switch to ${isMasonry ? "Grid" : "Masonry"}`} + tooltip={ + isMasonry + ? t("entry_list_header.switch_to_masonry") + : t("entry_list_header.switch_to_grid") + } > diff --git a/src/renderer/src/modules/entry-column/lists.tsx b/src/renderer/src/modules/entry-column/lists.tsx index 002610c4c..3c324fa84 100644 --- a/src/renderer/src/modules/entry-column/lists.tsx +++ b/src/renderer/src/modules/entry-column/lists.tsx @@ -7,6 +7,7 @@ import { useEntry } from "@renderer/store/entry" import type { HTMLMotionProps } from "framer-motion" import type { DOMAttributes, FC } from "react" import { forwardRef, memo, useCallback } from "react" +import { useTranslation } from "react-i18next" import type { VirtuosoHandle, VirtuosoProps } from "react-virtuoso" import { GroupedVirtuoso, Virtuoso } from "react-virtuoso" @@ -19,6 +20,7 @@ export const EntryListContent = forwardRef((props, ref) => ( export const EntryEmptyList = forwardRef>((props, ref) => { const unreadOnly = useGeneralSettingKey("unreadOnly") + const { t } = useTranslation() return ( > ) : (
- Zero Items + {t("words.zero_items")}
)}
diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index 65ed4dd10..f79c45be9 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -38,6 +38,7 @@ import { ErrorBoundary } from "@sentry/react" import type { FC } from "react" import { memo, useEffect, useLayoutEffect, useMemo, useRef } from "react" import { useHotkeys } from "react-hotkeys-hook" +import { useTranslation } from "react-i18next" import { LoadingWithIcon } from "../../components/ui/loading" import { EntryPlaceholderDaily } from "../ai/ai-daily/EntryPlaceholderDaily" @@ -80,6 +81,7 @@ export const EntryContent = ({ entryId }: { entryId: ActiveEntryId }) => { } export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, className }) => { + const { t } = useTranslation() const user = useWhoami() const { error, data, isPending } = useAuthQuery(Queries.entries.byId(entryId), { @@ -237,7 +239,7 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl
- AI summary + {t("entry_content.ai_summary")}
{summary.isLoading ? SummaryLoadingSkeleton : summary.data} @@ -327,6 +329,7 @@ const TitleMetaHandler: Component<{ } const ReadabilityContent = ({ entryId }: { entryId: string }) => { + const { t } = useTranslation() const result = useEntryReadabilityContent(entryId) return ( @@ -334,13 +337,12 @@ const ReadabilityContent = ({ entryId }: { entryId: string }) => { {result ? (

- This content is provided by Readability. If you find typographical anomalies, please go to - the source site to view the original content. + {t("entry_content.readability_notice")}

) : (
} /> - Fetching original content and processing... + {t("entry_content.fetching_content")}
)} @@ -404,11 +406,14 @@ const ReadabilityAutoToggle = ({ url, id }: { url: string; id: string }) => { } const RenderError: FallbackRender = ({ error }) => { + const { t } = useTranslation() const nextError = typeof error === "string" ? new Error(error) : (error as Error) return (
- Render error: {nextError.message} + + {t("entry_content.render_error")} {nextError.message} + { target="_blank" rel="noreferrer" > - Report issue + {t("entry_content.report_issue")}
) diff --git a/src/renderer/src/modules/feed-column/category-remove-dialog.tsx b/src/renderer/src/modules/feed-column/category-remove-dialog.tsx index 1de5960d7..49041f5a6 100644 --- a/src/renderer/src/modules/feed-column/category-remove-dialog.tsx +++ b/src/renderer/src/modules/feed-column/category-remove-dialog.tsx @@ -1,10 +1,12 @@ import { subscriptionActions } from "@renderer/store/subscription" import { useMutation } from "@tanstack/react-query" +import { Trans,useTranslation } from "react-i18next" import { Button } from "../../components/ui/button" import { useCurrentModal } from "../../components/ui/modal" export function CategoryRemoveDialogContent({ feedIdList }: { feedIdList: string[] }) { + const { t } = useTranslation() const deleteMutation = useMutation({ mutationFn: () => subscriptionActions.deleteCategory(feedIdList), }) @@ -13,20 +15,22 @@ export function CategoryRemoveDialogContent({ feedIdList }: { feedIdList: string return (
-

- This operation will delete your category, but the feeds it contains will be retained and - grouped by website. -

+ +

+ This operation will delete your category, but the feeds it contains will be retained and + grouped by website. +

+
diff --git a/src/renderer/src/modules/feed-column/category.tsx b/src/renderer/src/modules/feed-column/category.tsx index 86fb8fbaf..d8d24154f 100644 --- a/src/renderer/src/modules/feed-column/category.tsx +++ b/src/renderer/src/modules/feed-column/category.tsx @@ -15,6 +15,7 @@ import { useMutation } from "@tanstack/react-query" import { AnimatePresence, m } from "framer-motion" import type { FC } from "react" import { Fragment, memo, useEffect, useRef, useState } from "react" +import {useTranslation } from "react-i18next" import { useOnClickOutside } from "usehooks-ts" import { useModalStack } from "../../components/ui/modal/stacked/hooks" @@ -37,6 +38,8 @@ function FeedCategoryImpl({ expansion, showUnreadCount = true, }: FeedCategoryProps) { + const { t } = useTranslation() + const sortByUnreadFeedList = useFeedUnreadStore((state) => ids.sort((a, b) => (state.data[b] || 0) - (state.data[a] || 0)), ) @@ -127,11 +130,12 @@ function FeedCategoryImpl({ { type: "text", enabled: !!(folderName && typeof view === "number"), - label: "Change to other view", + label: t("sidebar.feed_column.context_menu.change_to_other_view"), submenu: views .filter((v) => v.view !== view) .map((v) => ({ - label: v.name, + // TODO: fix this type error + label: t(v.name), enabled: true, type: "text", shortcut: (v.view + 1).toString(), @@ -143,7 +147,7 @@ function FeedCategoryImpl({ }, { type: "text", - label: "Mark as read", + label: t("sidebar.feed_column.context_menu.mark_as_read"), click: () => { subscriptionActions.markReadByFeedIds(ids) }, @@ -151,18 +155,19 @@ function FeedCategoryImpl({ { type: "separator" }, { type: "text", - label: "Rename category", + label: t("sidebar.feed_column.context_menu.rename_category"), click: () => { setIsCategoryEditing(true) }, }, { type: "text", - label: "Delete category", - + label: t("sidebar.feed_column.context_menu.delete_category"), click: async () => { present({ - title: `Delete category ${folderName}?`, + title: t("sidebar.feed_column.context_menu.delete_category_confirmation", { + folderName, + }), content: () => , }) }, diff --git a/src/renderer/src/modules/feed-column/header.tsx b/src/renderer/src/modules/feed-column/header.tsx index 719ae2689..dcdbd90a1 100644 --- a/src/renderer/src/modules/feed-column/header.tsx +++ b/src/renderer/src/modules/feed-column/header.tsx @@ -11,6 +11,7 @@ import { cn } from "@renderer/lib/utils" import { m } from "framer-motion" import type { FC, PropsWithChildren } from "react" import { memo, useCallback, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { Link } from "react-router-dom" import { toast } from "sonner" @@ -31,7 +32,7 @@ const useBackHome = (active: number) => { export const FeedColumnHeader = memo(() => { const [active] = useSidebarActiveView() - + const { t } = useTranslation() const navigateBackHome = useBackHome(active) const normalStyle = !window.electron || window.electron.process.platform !== "darwin" return ( @@ -61,7 +62,7 @@ export const FeedColumnHeader = memo(() => { - + @@ -137,9 +138,14 @@ const LogoContextMenu: FC = ({ children }) => { const SearchActionButton = () => { const canSearch = useGeneralSettingKey("dataPersist") + const { t } = useTranslation() if (!canSearch) return null return ( - setAppSearchOpen(true)}> + setAppSearchOpen(true)} + > ) diff --git a/src/renderer/src/modules/feed-column/index.tsx b/src/renderer/src/modules/feed-column/index.tsx index 4f55aa694..c83c0a608 100644 --- a/src/renderer/src/modules/feed-column/index.tsx +++ b/src/renderer/src/modules/feed-column/index.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect */ + import { getReadonlyRoute } from "@renderer/atoms/route" import { useUISettingKey } from "@renderer/atoms/settings/ui" import { useSidebarActiveView } from "@renderer/atoms/sidebar" @@ -22,6 +22,7 @@ import { Lethargy } from "lethargy" import type { FC, PropsWithChildren } from "react" import { useCallback, useLayoutEffect, useRef, useState } from "react" import { isHotkeyPressed, useHotkeys } from "react-hotkeys-hook" +import { useTranslation } from "react-i18next" import { WindowUnderBlur } from "../../components/ui/background" import { FeedColumnHeader } from "./header" @@ -130,6 +131,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam ) const unreadByView = useUnreadByView() + const { t } = useTranslation() const showSidebarUnreadCount = useUISettingKey("sidebarShowUnreadCount") @@ -151,7 +153,8 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam {views.map((item, index) => (
- {view !== undefined && views[view].name} + {view !== undefined && t(views[view].name)}
@@ -128,7 +131,7 @@ function FeedListImpl({ className, view }: { className?: string; view: number }) }} > - Starred + {t("words.starred")}
{hasData ? ( @@ -151,7 +154,7 @@ function FeedListImpl({ className, view }: { className?: string; view: number }) const SortButton = () => { const { by, order } = useFeedListSort() - + const { t } = useTranslation() const LIST = [ { icon: "i-mgc-sort-ascending-cute-re", by: "count", order: "asc" }, { icon: "i-mgc-sort-descending-cute-re", by: "count", order: "desc" }, @@ -204,7 +207,7 @@ const SortButton = () => { >
- Select a sorting method + {t("sidebar.select_sort_method")}
{LIST.map(({ icon, by, order }) => { const current = getFeedListSort() diff --git a/src/renderer/src/modules/modal/shortcuts.tsx b/src/renderer/src/modules/modal/shortcuts.tsx index 100a8ed9d..6454698e6 100644 --- a/src/renderer/src/modules/modal/shortcuts.tsx +++ b/src/renderer/src/modules/modal/shortcuts.tsx @@ -10,6 +10,7 @@ import { cn } from "@renderer/lib/utils" import clsx from "clsx" import { m, useDragControls } from "framer-motion" import { useCallback, useEffect } from "react" +import { useTranslation } from "react-i18next" const ShortcutModalContent = () => { const { dismiss } = useCurrentModal() @@ -20,6 +21,7 @@ const ShortcutModalContent = () => { useEffect(() => { switchScope("Home") }, []) + const { t } = useTranslation("shortcuts") return ( { >

Shortcuts Guideline

- + -
+
{Object.keys(shortcuts).map((type) => (
{type}
@@ -60,7 +62,7 @@ const ShortcutModalContent = () => { index % 2 && "bg-native/40", )} > -
{shortcuts[type][action].name}
+
{t(shortcuts[type][action].name)}
{`${shortcuts[type][action].key}${shortcuts[type][action].extra ? `, ${shortcuts[type][action].extra}` : ""}`} diff --git a/src/renderer/src/modules/profile/profile-setting-form.tsx b/src/renderer/src/modules/profile/profile-setting-form.tsx index d42928c8a..9c5af1ce3 100644 --- a/src/renderer/src/modules/profile/profile-setting-form.tsx +++ b/src/renderer/src/modules/profile/profile-setting-form.tsx @@ -15,6 +15,7 @@ import { Input } from "@renderer/components/ui/input" import { apiClient } from "@renderer/lib/api-fetch" import { useMutation } from "@tanstack/react-query" import { useForm } from "react-hook-form" +import { useTranslation } from "react-i18next" import { toast } from "sonner" import { z } from "zod" @@ -25,6 +26,7 @@ const formSchema = z.object({ }) export const ProfileSettingForm = () => { + const { t } = useTranslation("settings") const user = useWhoami() const form = useForm>({ @@ -45,7 +47,7 @@ export const ProfileSettingForm = () => { if (user && variables) { setWhoami({ ...user, ...variables }) } - toast("Profile updated.", { + toast(t("profile.updateSuccess"), { duration: 3000, }) }, @@ -63,11 +65,11 @@ export const ProfileSettingForm = () => { name="handle" render={({ field }) => ( - Handle + {t("profile.handle.label")} - Your unique identifier. + {t("profile.handle.description")} )} @@ -77,11 +79,11 @@ export const ProfileSettingForm = () => { name="name" render={({ field }) => ( - Display Name + {t("profile.name.label")} - Your public display name. + {t("profile.name.description")} )} @@ -93,7 +95,7 @@ export const ProfileSettingForm = () => { render={({ field }) => (
- Avatar + {t("profile.avatar.label")} @@ -109,7 +111,7 @@ export const ProfileSettingForm = () => {
diff --git a/src/renderer/src/modules/settings/action-card.tsx b/src/renderer/src/modules/settings/action-card.tsx index f3a874d76..684691329 100644 --- a/src/renderer/src/modules/settings/action-card.tsx +++ b/src/renderer/src/modules/settings/action-card.tsx @@ -30,6 +30,8 @@ import type { ActionOperation, SupportedLanguages, } from "@renderer/models" +import { useMemo } from "react" +import { useTranslation } from "react-i18next" type ActionsInput = { name: string @@ -53,96 +55,6 @@ type ActionsInput = { } }[] -const OperationOptions = [ - { - name: "contains", - value: "contains", - types: ["text"], - }, - { - name: "does not contain", - value: "not_contains", - types: ["text"], - }, - { - name: "is equal to", - value: "eq", - types: ["number", "text", "view"], - }, - { - name: "is not equal to", - value: "not_eq", - types: ["number", "text", "view"], - }, - { - name: "is greater than", - value: "gt", - types: ["number"], - }, - { - name: "is less than", - value: "lt", - types: ["number"], - }, - { - name: "matches regex", - value: "regex", - types: ["text"], - }, -] - -const EntryOptions = [ - { - name: "All", - value: "all", - }, - { - name: "Title", - value: "title", - }, - { - name: "Content", - value: "content", - }, - { - name: "Author", - value: "author", - }, - { - name: "Url", - value: "url", - }, - { - name: "Order", - value: "order", - type: "number", - }, -] - -const FeedOptions = [ - { - name: "View", - value: "view", - type: "view", - }, - { - name: "Title", - value: "title", - }, - { - name: "Category", - value: "category", - }, - { - name: "Site URL", - value: "site_url", - }, - { - name: "Feed URL", - value: "feed_url", - }, -] - const TransitionOptions: { name: string value: SupportedLanguages @@ -165,16 +77,19 @@ const TransitionOptions: { }, ] -const FieldTableHeader = () => ( - - - - Field - Operator - Value - - -) +const FieldTableHeader = () => { + const { t } = useTranslation("settings") + return ( + + + + {t("actions.action_card.field")} + {t("actions.action_card.operator")} + {t("actions.action_card.value")} + + + ) +} const DeleteTableCell = ({ disabled, onClick }: { disabled?: boolean; onClick?: () => void }) => ( @@ -184,11 +99,19 @@ const DeleteTableCell = ({ disabled, onClick }: { disabled?: boolean; onClick?: ) -const AddTableRow = ({ onClick }: { onClick?: () => void }) => ( - -) +const AddTableRow = ({ onClick }: { onClick?: () => void }) => { + const { t } = useTranslation("settings") + return ( + + ) +} const OperationTableCell = ({ type, @@ -199,6 +122,48 @@ const OperationTableCell = ({ value?: ActionOperation onValueChange?: (value: ActionOperation) => void }) => { + const { t } = useTranslation("settings") + + const OperationOptions = useMemo(() => { + return [ + { + name: t("actions.action_card.operation_options.contains"), + value: "contains", + types: ["text"], + }, + { + name: t("actions.action_card.operation_options.does_not_contain"), + value: "not_contains", + types: ["text"], + }, + { + name: t("actions.action_card.operation_options.is_equal_to"), + value: "eq", + types: ["number", "text", "view"], + }, + { + name: t("actions.action_card.operation_options.is_not_equal_to"), + value: "not_eq", + types: ["number", "text", "view"], + }, + { + name: t("actions.action_card.operation_options.is_greater_than"), + value: "gt", + types: ["number"], + }, + { + name: t("actions.action_card.operation_options.is_less_than"), + value: "lt", + types: ["number"], + }, + { + name: t("actions.action_card.operation_options.matches_regex"), + value: "regex", + types: ["text"], + }, + ] + }, [t]) + const options = OperationOptions.filter((option) => option.types.includes(type)) return ( @@ -257,6 +222,64 @@ export function ActionCard({ data: ActionsInput[number] onChange: (data: ActionsInput[number] | null) => void }) { + const { t } = useTranslation("settings") + + const EntryOptions = useMemo(() => { + return [ + { + name: t("actions.action_card.entry_options.all"), + value: "all", + }, + { + name: t("actions.action_card.entry_options.title"), + value: "title", + }, + { + name: t("actions.action_card.entry_options.content"), + value: "content", + }, + { + name: t("actions.action_card.entry_options.author"), + value: "author", + }, + { + name: t("actions.action_card.entry_options.url"), + value: "url", + }, + { + name: t("actions.action_card.entry_options.order"), + value: "order", + type: "number", + }, + ] + }, [t]) + + const FeedOptions = useMemo(() => { + return [ + { + name: t("actions.action_card.feed_options.view"), + value: "view", + type: "view", + }, + { + name: t("actions.action_card.feed_options.title"), + value: "title", + }, + { + name: t("actions.action_card.feed_options.category"), + value: "category", + }, + { + name: t("actions.action_card.feed_options.site_url"), + value: "site_url", + }, + { + name: t("actions.action_card.feed_options.feed_url"), + value: "feed_url", + }, + ] + }, [t]) + return ( @@ -272,7 +295,7 @@ export function ActionCard({ > -

Name

+

{t("actions.action_card.name")}

-

When feeds match…

+

+ {t("actions.action_card.when_feeds_match")} +

0 ? "filter" : "all"} @@ -302,8 +327,8 @@ export function ActionCard({ onChange(data) }} > - - + +
@@ -384,10 +409,12 @@ export function ActionCard({ )}
-

Then do…

+

{t("actions.action_card.then_do")}

- Generate summary using AI + + {t("actions.action_card.generate_summary")} + { @@ -399,7 +426,9 @@ export function ActionCard({
- Translate into + + {t("actions.action_card.translate_into")} + { } export const UIFontSelector = () => { + const { t } = useTranslation("settings") // filter out the fallback font const data = useFontData() .slice(1) @@ -104,7 +107,7 @@ export const UIFontSelector = () => { return (
- UI Font + {t("appearance.ui_font")} { + const { t } = useTranslation("settings") const uiTextSize = useUISettingSelector((state) => state.uiTextSize) return (
- Text size + {t("appearance.text_size")} { } export const LanguageSelector = () => { - const { t, i18n } = useTranslation() + const { t, i18n } = useTranslation("settings") const { t: langT } = useTranslation("lang") const language = useGeneralSettingSelector((state) => state.language) @@ -207,7 +208,7 @@ export const LanguageSelector = () => { : fallbackLanguage return (
- {t("words.language")} + {t("general.language")} @@ -112,7 +126,7 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { name="amount" render={({ field }) => ( - Amount + {t("wallet.withdraw.amountLabel")} void }) => { />
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 aa758c19c..1d2f5847c 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 @@ -24,8 +24,10 @@ import { usePresentUserProfileModal } from "@renderer/modules/profile/hooks" import { SettingSectionTitle } from "@renderer/modules/settings/section" import { Balance } from "@renderer/modules/wallet/balance" import { useWallet, useWalletTransactions } from "@renderer/queries/wallet" +import { useTranslation } from "react-i18next" export const TransactionsSection = () => { + const { t } = useTranslation("settings") const user = useWhoami() const wallet = useWallet({ userId: user?.id }) const myWallet = wallet.data?.[0] @@ -42,33 +44,31 @@ export const TransactionsSection = () => { ) } - // if (transactions.data?.length === 0) return
No transactions
- return (
- + - Type + {t("wallet.transactions.type")} - Amount + {t("wallet.transactions.amount")} - From + {t("wallet.transactions.from")} - To + {t("wallet.transactions.to")} - Date + {t("wallet.transactions.date")} - Tx + {t("wallet.transactions.tx")} @@ -111,7 +111,9 @@ export const TransactionsSection = () => {
{!transactions.data?.length && ( -
No transactions
+
+ {t("wallet.transactions.noTransactions")} +
)}
@@ -122,19 +124,22 @@ const TypeRenderer = ({ type, }: { type: NonNullable["data"]>[number]["type"] -}) => ( -
- {type} -
-) +}) => { + const { t } = useTranslation("settings") + return ( +
+ {t(`wallet.transactions.types.${type}`)} +
+ ) +} const BalanceRenderer = ({ sign, @@ -161,10 +166,11 @@ const UserRenderer = ({ | "fromUser" | "toUser"] }) => { + const { t } = useTranslation("settings") const me = useWhoami() const isMe = user?.id === me?.id - const name = isMe ? "You" : user?.name || APP_NAME + const name = isMe ? t("wallet.transactions.you") : user?.name || APP_NAME const presentUserModal = usePresentUserProfileModal("drawer") return ( @@ -183,7 +189,9 @@ const UserRenderer = ({ )} -
{isMe ? You : name}
+
+ {isMe ? {t("wallet.transactions.you")} : name} +
) } diff --git a/src/renderer/src/modules/settings/title.tsx b/src/renderer/src/modules/settings/title.tsx index eb15f66f9..7287ad3fa 100644 --- a/src/renderer/src/modules/settings/title.tsx +++ b/src/renderer/src/modules/settings/title.tsx @@ -6,9 +6,9 @@ import { settings } from "./constants" import type { SettingPageConfig } from "./utils" export const SettingsSidebarTitle = ({ path, className }: { path: string; className?: string }) => { + const { t } = useTranslation("settings") const tab = settings.find((t) => t.path === path) - const { t } = useTranslation() if (!tab) { return null } @@ -28,13 +28,13 @@ export const SettingsTitle = ({ className?: string loader?: () => SettingPageConfig }) => { + const { t } = useTranslation("settings") const { iconName, name: title, headerIcon, } = (useLoaderData() || loader?.() || {}) as SettingPageConfig - const { t } = useTranslation() if (!title) { return null } diff --git a/src/renderer/src/modules/settings/utils.ts b/src/renderer/src/modules/settings/utils.ts index 4e8ce319b..221c1c35f 100644 --- a/src/renderer/src/modules/settings/utils.ts +++ b/src/renderer/src/modules/settings/utils.ts @@ -1,7 +1,6 @@ - export interface SettingPageConfig { iconName: string - name: I18nKeys + name: I18nKeysForSettings priority: number headerIcon?: string } diff --git a/src/renderer/src/pages/(external)/invitation.tsx b/src/renderer/src/pages/(external)/invitation.tsx index dfd169f40..57b365863 100644 --- a/src/renderer/src/pages/(external)/invitation.tsx +++ b/src/renderer/src/pages/(external)/invitation.tsx @@ -16,6 +16,7 @@ import { getFetchErrorMessage } from "@renderer/lib/error-parser" import { useInvitationMutation } from "@renderer/queries/invitations" import { useEffect } from "react" import { useForm } from "react-hook-form" +import { useTranslation } from "react-i18next" import { useNavigate } from "react-router-dom" import { z } from "zod" @@ -24,6 +25,7 @@ const formSchema = z.object({ }) export function Component() { + const { t } = useTranslation("settings") const navigate = useNavigate() const form = useForm>({ resolver: zodResolver(formSchema), @@ -55,7 +57,7 @@ export function Component() { name="code" render={({ field }) => ( - Invitation Code + {t("invitation.title")} @@ -71,12 +73,14 @@ export function Component() { disabled={!form.formState.isValid} isLoading={invitationMutation.isPending} > - Activate + {t("invitation.activate")}
+

{t("invitation.earlyAccessMessage")}

+

{t("invitation.getCodeMessage")}

😰 Sorry, Follow is currently in early access and requires an invitation code to use. diff --git a/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx b/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx index 43b58efe4..d1fa1fa92 100644 --- a/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx +++ b/src/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx @@ -10,34 +10,38 @@ import { useSearchParams } from "react-router-dom" import { useSubViewTitle } from "../hooks" -const tabs = [ +const tabs: { + name: I18nKeys + value: string + disabled?: boolean +}[] = [ { - name: "Search", + name: "words.search", value: "search", }, { - name: "RSS", + name: "words.rss", value: "rss", }, { - name: "RSSHub", + name: "words.rsshub", value: "rsshub", }, { - name: "RSS3", + name: "words.rss3", value: "rss3", }, { - name: "User", + name: "words.user", value: "user", }, { - name: "Email", + name: "words.email", value: "email", disabled: true, }, { - name: "Import", + name: "words.import", value: "import", }, ] @@ -45,7 +49,7 @@ const tabs = [ export function Component() { const [search, setSearch] = useSearchParams() const { t } = useTranslation() - useSubViewTitle("Discover") + useSubViewTitle("words.discover") return ( <> @@ -62,7 +66,7 @@ export function Component() { {tabs.map((tab) => ( - {tab.name} + {t(tab.name)} ))} diff --git a/src/renderer/src/pages/(main)/(layer)/(subview)/hooks.ts b/src/renderer/src/pages/(main)/(layer)/(subview)/hooks.ts index 5b6637ee5..6723d915b 100644 --- a/src/renderer/src/pages/(main)/(layer)/(subview)/hooks.ts +++ b/src/renderer/src/pages/(main)/(layer)/(subview)/hooks.ts @@ -2,8 +2,8 @@ import { useTitle } from "@renderer/hooks/common" import { atom, useAtomValue } from "jotai" import { useHydrateAtoms } from "jotai/utils" -const titleAtom = atom(null) -export const useSubViewTitle = (title: string) => { +const titleAtom = atom(null) +export const useSubViewTitle = (title: I18nKeys) => { useTitle(title) useHydrateAtoms([[titleAtom, title]]) } diff --git a/src/renderer/src/pages/(main)/(layer)/(subview)/layout.tsx b/src/renderer/src/pages/(main)/(layer)/(subview)/layout.tsx index a9f3d44f2..2da06acc1 100644 --- a/src/renderer/src/pages/(main)/(layer)/(subview)/layout.tsx +++ b/src/renderer/src/pages/(main)/(layer)/(subview)/layout.tsx @@ -6,6 +6,7 @@ import { ScrollArea } from "@renderer/components/ui/scroll-area" import { springScrollTo } from "@renderer/lib/scroller" import { cn } from "@renderer/lib/utils" import { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { Outlet, useNavigate } from "react-router-dom" import { useSubViewTitleValue } from "./hooks" @@ -33,6 +34,7 @@ export function Component() { } }, [scrollRef, title]) + const { t } = useTranslation() return (

- Back + {t("words.back", { ns: "common" })}
-
{title}
+
+ {title && t(title)} +
diff --git a/src/renderer/src/pages/(main)/(layer)/feeds/[feedId]/layout.tsx b/src/renderer/src/pages/(main)/(layer)/feeds/[feedId]/layout.tsx index 4f1f289d6..d54c90b5a 100644 --- a/src/renderer/src/pages/(main)/(layer)/feeds/[feedId]/layout.tsx +++ b/src/renderer/src/pages/(main)/(layer)/feeds/[feedId]/layout.tsx @@ -14,7 +14,7 @@ export function Component() { // Memo this initial value to avoid re-render const entryColWidth = useMemo(() => getUISettings().entryColWidth, []) - const { feedId, view } = useRouteParms() + const { view } = useRouteParms() const inWideMode = view ? views[view].wideMode : false const { position, separatorProps, isDragging, separatorCursor } = useResizable({ axis: "x", @@ -36,7 +36,7 @@ export function Component() { width: position, }} > - +
{!inWideMode && ( diff --git a/src/renderer/src/pages/(main)/layout.tsx b/src/renderer/src/pages/(main)/layout.tsx index 869891aad..06b477d0d 100644 --- a/src/renderer/src/pages/(main)/layout.tsx +++ b/src/renderer/src/pages/(main)/layout.tsx @@ -29,33 +29,38 @@ import { throttle } from "lodash-es" import type { PropsWithChildren } from "react" import React, { useEffect, useRef, useState } from "react" import { useHotkeys } from "react-hotkeys-hook" +import { useTranslation } from "react-i18next" import { useResizable } from "react-resizable-layout" import { Outlet } from "react-router-dom" -const FooterInfo = () => ( -
- {APP_VERSION?.[0] === "0" && ( -
- Early Access {GIT_COMMIT_SHA ? `(${GIT_COMMIT_SHA.slice(0, 7).toUpperCase()})` : ""} -
- )} +const FooterInfo = () => { + const { t } = useTranslation() + return ( +
+ {APP_VERSION?.[0] === "0" && ( +
+ {t("early_access")}{" "} + {GIT_COMMIT_SHA ? `(${GIT_COMMIT_SHA.slice(0, 7).toUpperCase()})` : ""} +
+ )} - {!ELECTRON && ( -
- -
- )} -
-) + {!ELECTRON && ( +
+ +
+ )} +
+ ) +} const errorTypes = [ ErrorComponentType.Page, diff --git a/src/renderer/src/pages/settings/(settings)/about.tsx b/src/renderer/src/pages/settings/(settings)/about.tsx index cac930c73..6ab5a5feb 100644 --- a/src/renderer/src/pages/settings/(settings)/about.tsx +++ b/src/renderer/src/pages/settings/(settings)/about.tsx @@ -3,7 +3,7 @@ import { defineSettingPageData } from "@renderer/modules/settings/utils" export const loader = defineSettingPageData({ iconName: "i-mgc-information-cute-re", - name: "settings.titles.about", + name: "titles.about", priority: 9999, }) export const Component = () => diff --git a/src/renderer/src/pages/settings/(settings)/actions.tsx b/src/renderer/src/pages/settings/(settings)/actions.tsx index 1966897d4..d4e50d588 100644 --- a/src/renderer/src/pages/settings/(settings)/actions.tsx +++ b/src/renderer/src/pages/settings/(settings)/actions.tsx @@ -14,15 +14,15 @@ import { defineSettingPageData } from "@renderer/modules/settings/utils" import { Queries } from "@renderer/queries" import { useMutation } from "@tanstack/react-query" import { useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { toast } from "sonner" const iconName = "i-mgc-magic-2-cute-re" - const priority = 1020 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.actions", + name: "titles.actions", priority, }) @@ -49,6 +49,7 @@ type ActionsInput = { }[] export function Component() { + const { t } = useTranslation("settings") const actions = useAuthQuery(Queries.action.getAll()) const [actionsData, setActionsData] = useState([]) @@ -75,7 +76,7 @@ export function Component() { }, onSuccess: () => { Queries.action.getAll().invalidate() - toast("🎉 Actions saved.") + toast(t("actions.saveSuccess")) }, onError: (error) => { toastFetchError(error) @@ -106,7 +107,7 @@ export function Component() { setActionsData([ ...actionsData, { - name: `Action ${actionsData.length + 1}`, + name: t("actions.actionName", { number: actionsData.length + 1 }), condition: [], result: {}, }, @@ -114,7 +115,7 @@ export function Component() { }} > - New Rule + {t("actions.newRule")}
diff --git a/src/renderer/src/pages/settings/(settings)/appearance.tsx b/src/renderer/src/pages/settings/(settings)/appearance.tsx index fad4c4c5d..51fdccda3 100644 --- a/src/renderer/src/pages/settings/(settings)/appearance.tsx +++ b/src/renderer/src/pages/settings/(settings)/appearance.tsx @@ -1,16 +1,21 @@ import { SettingAppearance } from "@renderer/modules/settings/tabs/apperance" +import { SettingsTitle } from "@renderer/modules/settings/title" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-palette-cute-re" - const priority = 1010 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.appearance", + name: "titles.appearance", priority, }) export function Component() { - return + return ( + <> + + + + ) } diff --git a/src/renderer/src/pages/settings/(settings)/general.tsx b/src/renderer/src/pages/settings/(settings)/general.tsx index dd5c208ec..b7d839de6 100644 --- a/src/renderer/src/pages/settings/(settings)/general.tsx +++ b/src/renderer/src/pages/settings/(settings)/general.tsx @@ -2,12 +2,11 @@ import { SettingGeneral } from "@renderer/modules/settings/tabs/general" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-settings-7-cute-re" - const priority = 1000 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.general", + name: "titles.general", priority, }) diff --git a/src/renderer/src/pages/settings/(settings)/integration.tsx b/src/renderer/src/pages/settings/(settings)/integration.tsx index 9a67c8b25..58715801a 100644 --- a/src/renderer/src/pages/settings/(settings)/integration.tsx +++ b/src/renderer/src/pages/settings/(settings)/integration.tsx @@ -2,12 +2,11 @@ import { SettingIntegration } from "@renderer/modules/settings/tabs/integration" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-department-cute-re" - const priority = 1025 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.integration", + name: "titles.integration", priority, }) diff --git a/src/renderer/src/pages/settings/(settings)/invitations.tsx b/src/renderer/src/pages/settings/(settings)/invitations.tsx index c2a8d82b6..2f80a7aa8 100644 --- a/src/renderer/src/pages/settings/(settings)/invitations.tsx +++ b/src/renderer/src/pages/settings/(settings)/invitations.tsx @@ -3,12 +3,11 @@ import { SettingsTitle } from "@renderer/modules/settings/title" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-heart-hand-cute-re" - const priority = 1055 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.invitations", + name: "titles.invitations", priority, }) diff --git a/src/renderer/src/pages/settings/(settings)/profile.tsx b/src/renderer/src/pages/settings/(settings)/profile.tsx index e181629f1..54edd12e3 100644 --- a/src/renderer/src/pages/settings/(settings)/profile.tsx +++ b/src/renderer/src/pages/settings/(settings)/profile.tsx @@ -3,11 +3,10 @@ import { SettingsTitle } from "@renderer/modules/settings/title" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-user-setting-cute-re" - const priority = 1030 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.profile", + name: "titles.profile", priority, }) diff --git a/src/renderer/src/pages/settings/(settings)/shortcuts.tsx b/src/renderer/src/pages/settings/(settings)/shortcuts.tsx index d10bf27fb..ca6acfb2f 100644 --- a/src/renderer/src/pages/settings/(settings)/shortcuts.tsx +++ b/src/renderer/src/pages/settings/(settings)/shortcuts.tsx @@ -3,17 +3,18 @@ import { shortcuts } from "@renderer/constants/shortcuts" import { cn } from "@renderer/lib/utils" import { SettingsTitle } from "@renderer/modules/settings/title" import { defineSettingPageData } from "@renderer/modules/settings/utils" +import { useTranslation } from "react-i18next" const iconName = "i-mgc-hotkey-cute-re" - const priority = 1040 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.shortcuts", + name: "titles.shortcuts", priority, }) export function Component() { + const { t } = useTranslation("shortcuts") return ( <> @@ -31,7 +32,7 @@ export function Component() { index % 2 && "bg-native/40", )} > -
{shortcuts[type][action].name}
+
{t(shortcuts[type][action].name)}
{`${shortcuts[type][action].key}${shortcuts[type][action].extra ? `, ${shortcuts[type][action].extra}` : ""}`} diff --git a/src/renderer/src/pages/settings/(settings)/wallet.tsx b/src/renderer/src/pages/settings/(settings)/wallet.tsx index 26d10a299..fa79afe74 100644 --- a/src/renderer/src/pages/settings/(settings)/wallet.tsx +++ b/src/renderer/src/pages/settings/(settings)/wallet.tsx @@ -2,12 +2,11 @@ import { SettingWallet } from "@renderer/modules/settings/tabs/wallet" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = `i-mgc-power-outline` - const priority = 1050 export const loader = defineSettingPageData({ iconName, - name: "settings.titles.power", + name: "titles.power", priority, headerIcon: `i-mgc-power text-accent`, }) diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index d02b24d16..665212a10 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -1,8 +1,11 @@ -import { dayjsLocaleImportMap } from "@renderer/@types/constants" +import { + currentSupportedLanguages, + dayjsLocaleImportMap, + defaultNS, +} from "@renderer/@types/constants" import { defaultResources } from "@renderer/@types/default-resource" import { getGeneralSettings } from "@renderer/atoms/settings/general" -import { currentSupportedLanguages, defaultNS, i18nAtom } from "@renderer/i18n" -import { nextFrame } from "@renderer/lib/dom" +import { i18nAtom } from "@renderer/i18n" import { EventBus } from "@renderer/lib/event-bus" import { jotaiStore } from "@renderer/lib/jotai" import dayjs from "dayjs" @@ -87,9 +90,11 @@ export const I18nProvider: FC = ({ children }) => { useEffect( () => EventBus.subscribe("I18N_UPDATE", () => { - nextFrame(() => { - update(i18next.cloneInstance()) + const lang = getGeneralSettings().language + const nextI18n = i18next.cloneInstance({ + lng: lang, }) + update(nextI18n) }), [update], ) diff --git a/src/renderer/src/store/feed/hooks.ts b/src/renderer/src/store/feed/hooks.ts index 2494ba583..2ce07a868 100644 --- a/src/renderer/src/store/feed/hooks.ts +++ b/src/renderer/src/store/feed/hooks.ts @@ -7,6 +7,7 @@ import { import { useRouteParms } from "@renderer/hooks/biz/useRouteParams" import type { FeedModel } from "@renderer/models" import { useMemo } from "react" +import { useTranslation } from "react-i18next" import { useShallow } from "zustand/react/shallow" import { getSubscriptionByFeedId } from "../subscription" @@ -36,6 +37,8 @@ export const useFeedByIdSelector = ( ) export const useFeedHeaderTitle = () => { + const { t } = useTranslation() + const { feedId: currentFeedId, view } = useRouteParms() const feedTitle = useFeedByIdSelector(currentFeedId, (feed) => feed.title) @@ -46,10 +49,11 @@ export const useFeedHeaderTitle = () => { switch (currentFeedId) { case ROUTE_FEED_PENDING: { - return views[view].name + // TODO: fix this type error + return t(views[view].name) } case FEED_COLLECTION_LIST: { - return "Starred" + return t("words.starred") } default: { if (currentFeedId?.startsWith(ROUTE_FEED_IN_FOLDER)) { From 304cb7f59f8622cb076e5bf2b240b1a3f6c2614c Mon Sep 17 00:00:00 2001 From: Auuu Nya Date: Fri, 13 Sep 2024 18:40:26 +0800 Subject: [PATCH 05/66] feat: sort the query results by the number of followers in asc order (#379) Co-authored-by: zhangchenyang --- src/renderer/src/modules/discover/form.tsx | 178 +++++++++++---------- 1 file changed, 90 insertions(+), 88 deletions(-) diff --git a/src/renderer/src/modules/discover/form.tsx b/src/renderer/src/modules/discover/form.tsx index ca2c1a618..609c200d1 100644 --- a/src/renderer/src/modules/discover/form.tsx +++ b/src/renderer/src/modules/discover/form.tsx @@ -144,97 +144,99 @@ export function DiscoverForm({ type }: { type: string }) { {mutation.data?.length > 1 && "s"}
- {mutation.data?.map((item) => ( - - - - - {item.docs ? ( - - - - - - ) : ( - <> - - {!!item.entries?.length && ( -
- {item.entries - .filter((e) => !!e) - .map((entry) => { - const assertEntry = entry - return ( - - {assertEntry.media?.[0] ? ( - - ) : ( -
+ {mutation.data + ?.sort((a, b) => (b.subscriptionCount ?? 0) - (a.subscriptionCount ?? 0)) + .map((item) => ( + + + + + {item.docs ? ( + + + + + + ) : ( + <> + + {!!item.entries?.length && ( +
+ {item.entries + .filter((e) => !!e) + .map((entry) => { + const assertEntry = entry + return ( + + {assertEntry.media?.[0] ? ( + + ) : ( +
+ {assertEntry.title} +
+ )} +
{assertEntry.title}
- )} -
- {assertEntry.title} -
-
- ) - })} + + ) + })} +
+ )} +
+ + {item.isSubscribed ? ( + + ) : ( + + )} +
+ + {item.subscriptionCount} + {" "} + Followers
- )} - - - {item.isSubscribed ? ( - - ) : ( - - )} -
- - {item.subscriptionCount} - {" "} - Followers -
-
- - )} - - ))} +
+ + )} + + ))}
)} From 92bfce0f7e5faa6eef8d19d813f682271dc1bbf0 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 20:02:34 +0800 Subject: [PATCH 06/66] perf: merge all namespace of i18n resource in prod Signed-off-by: Innei --- configs/vite.render.config.ts | 50 +++++++++++++++++++- src/renderer/src/i18n.ts | 10 ---- src/renderer/src/providers/i18n-provider.tsx | 46 +++++++++--------- vite.config.ts | 3 +- 4 files changed, 71 insertions(+), 38 deletions(-) diff --git a/configs/vite.render.config.ts b/configs/vite.render.config.ts index aa5949d1a..fe4cba876 100644 --- a/configs/vite.render.config.ts +++ b/configs/vite.render.config.ts @@ -1,5 +1,5 @@ -import { readFileSync } from "node:fs" -import { resolve } from "node:path" +import fs, { readFileSync } from "node:fs" +import path, { resolve } from "node:path" import * as babel from "@babel/core" import generate from "@babel/generator" @@ -14,6 +14,51 @@ import { getGitHash } from "../scripts/lib" const pkg = JSON.parse(readFileSync("package.json", "utf8")) const isCI = process.env.CI === "true" || process.env.CI === "1" +function localesPlugin(): Plugin { + return { + name: "locales-merge", + enforce: "post", + generateBundle(options, bundle) { + const localesDir = path.resolve(__dirname, "locales") + const namespaces = fs.readdirSync(localesDir) + const languageResources = {} + + namespaces.forEach((namespace) => { + const namespacePath = path.join(localesDir, namespace) + const files = fs.readdirSync(namespacePath).filter((file) => file.endsWith(".json")) + + files.forEach((file) => { + const lang = path.basename(file, ".json") + const filePath = path.join(namespacePath, file) + const content = JSON.parse(fs.readFileSync(filePath, "utf-8")) + + if (!languageResources[lang]) { + languageResources[lang] = {} + } + languageResources[lang][namespace] = content + }) + }) + + Object.entries(languageResources).forEach(([lang, resources]) => { + const fileName = `locales/${lang}.js` + const content = `export default ${JSON.stringify(resources)};` + + this.emitFile({ + type: "asset", + fileName, + source: content, + }) + }) + + // Remove original JSON chunks + Object.keys(bundle).forEach((key) => { + if (key.startsWith("locales/") && key.endsWith(".json")) { + delete bundle[key] + } + }) + }, + } +} export const viteRenderBaseConfig = { resolve: { @@ -52,6 +97,7 @@ export const viteRenderBaseConfig = { }, }), + localesPlugin(), viteTwToRawString(), { diff --git a/src/renderer/src/i18n.ts b/src/renderer/src/i18n.ts index 99c280b7b..3c541f805 100644 --- a/src/renderer/src/i18n.ts +++ b/src/renderer/src/i18n.ts @@ -29,16 +29,7 @@ if (import.meta.hot) { async ({ file, content }: { file: string; content: string }) => { const resources = JSON.parse(content) const i18next = jotaiStore.get(i18nAtom) - // `file` is absolute path e.g. /Users/innei/git/follow/locales/en.json - // Absolute path e.g. /Users/innei/git/follow/locales//en.json - // 1. parse root language - // if (!file.includes("locales/namespaces")) { - // const lang = file.split("/").pop()?.replace(".json", "") - // if (!lang) return - // i18next.addResourceBundle(lang, defaultNS, resources, true, true) - // i18next.reloadResources(lang, defaultNS) - // } else { const nsName = file.match(/locales\/(.+?)\//)?.[1] if (!nsName) return @@ -48,7 +39,6 @@ if (import.meta.hot) { console.info("reload", lang, nsName) await i18next.reloadResources(lang, nsName) - // } import.meta.env.DEV && EventBus.dispatch("I18N_UPDATE", "") }, diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index 665212a10..61086b8fc 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -42,37 +42,35 @@ const langChangedHandler = async (lang: string) => { loadingLangLock.add(lang) - const nsGlobbyMap = import.meta.glob("@locales/*/*.json") + if (import.meta.env.DEV) { + const nsGlobbyMap = import.meta.glob("@locales/*/*.json") - // const rootGlobbyMap = import.meta.glob("@locales/*.json") - // const rootResources = await rootGlobbyMap[`../../locales/${lang}.json`]() - // .then((m: any) => m.default) - // .catch(() => { - // toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) - // }) - // i18next.addResourceBundle(lang, defaultNS, rootResources, true, true) + const namespaces = Object.keys(defaultResources.en) - const namespaces = Object.keys(defaultResources.en) + const res = await Promise.allSettled( + namespaces.map(async (ns) => { + const loader = nsGlobbyMap[`../../locales/${ns}/${lang}.json`] - const res = await Promise.allSettled( - namespaces.map(async (ns) => { - // if (ns === defaultNS) return + if (!loader) return + const nsResources = await loader().then((m: any) => m.default) - const loader = nsGlobbyMap[`../../locales/${ns}/${lang}.json`] + i18next.addResourceBundle(lang, ns, nsResources, true, true) + }), + ) - if (!loader) return - const nsResources = await loader().then((m: any) => m.default) + for (const r of res) { + if (r.status === "rejected") { + toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) + loadingLangLock.delete(lang) - i18next.addResourceBundle(lang, ns, nsResources, true, true) - }), - ) + return + } + } + } else { + const res = await eval(`import('/locales/${lang}.js').then((res) => res?.default || res)`) - for (const r of res) { - if (r.status === "rejected") { - toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) - loadingLangLock.delete(lang) - - return + for (const namespace in res) { + i18next.addResourceBundle(lang, namespace, res[namespace], true, true) } } diff --git a/vite.config.ts b/vite.config.ts index 4186f4194..86b395048 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -79,7 +79,7 @@ export default ({ mode }) => { __debug_proxy: resolve(ROOT, "/__debug_proxy.html"), }, output: { - experimentalMinChunkSize: 500_000, + // experimentalMinChunkSize: 500_000, }, }, }, @@ -97,7 +97,6 @@ export default ({ mode }) => { }), htmlPlugin(typedEnv), mkcert(), - devPrint(), process.env.ANALYZER && analyzer(), From f3f3cac2b4ff0865f863b848397f0e27caa435b3 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 20:05:47 +0800 Subject: [PATCH 07/66] fix: config `__dirname` resolve Signed-off-by: Innei --- configs/vite.render.config.ts | 2 +- vite.config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/vite.render.config.ts b/configs/vite.render.config.ts index fe4cba876..36dd7d4f3 100644 --- a/configs/vite.render.config.ts +++ b/configs/vite.render.config.ts @@ -19,7 +19,7 @@ function localesPlugin(): Plugin { name: "locales-merge", enforce: "post", generateBundle(options, bundle) { - const localesDir = path.resolve(__dirname, "locales") + const localesDir = path.resolve(__dirname, "../locales") const namespaces = fs.readdirSync(localesDir) const languageResources = {} diff --git a/vite.config.ts b/vite.config.ts index 86b395048..cd6ace689 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -79,7 +79,8 @@ export default ({ mode }) => { __debug_proxy: resolve(ROOT, "/__debug_proxy.html"), }, output: { - // experimentalMinChunkSize: 500_000, + // 10KB + experimentalMinChunkSize: 10_000, }, }, }, From d81c2b5791fcf1284809b68dd68b4067581cdb44 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 21:34:24 +0800 Subject: [PATCH 08/66] feat: i18n for user profile Signed-off-by: Innei --- locales/app/en.json | 15 ++++++ locales/app/zh-CN.json | 15 ++++++ locales/common/en.json | 8 ++++ locales/common/zh-CN.json | 3 ++ locales/settings/zh-CN.json | 4 +- package.json | 2 +- pnpm-lock.yaml | 13 +++-- .../src/components/ui/modal/stacked/modal.tsx | 4 +- src/renderer/src/hooks/common/index.ts | 1 + src/renderer/src/hooks/common/useI18n.ts | 23 +++++++++ src/renderer/src/lib/utils.ts | 3 ++ .../components/mark-all-button.tsx | 9 ++-- src/renderer/src/modules/panel/cmdk.tsx | 47 ++++++++++++------- .../modules/profile/user-profile-modal.tsx | 19 ++++---- src/renderer/src/providers/i18n-provider.tsx | 12 ++++- tsconfig.node.json | 2 + 16 files changed, 141 insertions(+), 39 deletions(-) create mode 100644 src/renderer/src/hooks/common/useI18n.ts diff --git a/locales/app/en.json b/locales/app/en.json index 5839f757e..18249e9ef 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -73,6 +73,16 @@ "mark_all_read_button.mark_all_as_read": "Mark all as read", "mark_all_read_button.mark_as_read": "Mark {{which}} as read", "mark_all_read_button.undo": "Undo", + "search.empty.no_results": "No results found.", + "search.group.entries": "Entries", + "search.group.feeds": "Feeds", + "search.options.all": "All", + "search.options.entries": "Entries", + "search.options.feeds": "Feeds", + "search.options.search_type": "Search Type", + "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.", "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.", @@ -101,6 +111,11 @@ "signin.sign_in_to": "Sign in to", "sync_indicator.offline": "Offline", "sync_indicator.synced": "Synced with server", + "user_profile.close": "Close", + "user_profile.edit": "Edit", + "user_profile.loading": "Loading", + "user_profile.share": "Share", + "user_profile.toggle_item_style": "Toggle Item Style", "words.add": "Add", "words.confirm": "Confirm", "words.discover": "Discover", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 151373ef2..8e9f43af6 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -73,6 +73,16 @@ "mark_all_read_button.mark_all_as_read": "全部标记为已读", "mark_all_read_button.mark_as_read": "标记{{which}}为已读", "mark_all_read_button.undo": "撤消", + "search.empty.no_results": "未找到结果。", + "search.group.entries": "条目", + "search.group.feeds": "订阅源", + "search.options.all": "全部", + "search.options.entries": "条目", + "search.options.feeds": "订阅源", + "search.options.search_type": "搜索类型", + "search.placeholder": "搜索...", + "search.result_count_local_mode": "(本地模式)", + "search.tooltip.local_search": "此搜索仅涵盖本地可用数据。尝试重新获取以包含最新数据。", "sidebar.category_remove_dialog.cancel": "取消", "sidebar.category_remove_dialog.continue": "继续", "sidebar.category_remove_dialog.description": "此操作将删除您的类别,但其中包含的 Feed 将保留并按网站分组。", @@ -101,6 +111,11 @@ "signin.sign_in_to": "登录到", "sync_indicator.offline": "离线", "sync_indicator.synced": "已与服务器同步", + "user_profile.close": "关闭", + "user_profile.edit": "编辑", + "user_profile.loading": "加载中", + "user_profile.share": "分享", + "user_profile.toggle_item_style": "切换列表样式", "words.add": "添加", "words.confirm": "确认", "words.discover": "发现", diff --git a/locales/common/en.json b/locales/common/en.json index 8e5c17f32..5350e008e 100644 --- a/locales/common/en.json +++ b/locales/common/en.json @@ -10,10 +10,18 @@ "tips.load-lng-error": "Failed to load language pack", "words.back": "Back", "words.copy": "Copy", + "words.edit": "Edit", "words.entry": "Entry", "words.id": "ID", "words.items_one": "Item", "words.items_other": "Items", + "words.local": "local", + "words.record": "record", + "words.record_one": "record", + "words.record_other": "records", + "words.result": "result", + "words.result_one": "result", + "words.result_other": "results", "words.space": " ", "words.which.all": "All" } diff --git a/locales/common/zh-CN.json b/locales/common/zh-CN.json index 459bc2fa8..9d94f3309 100644 --- a/locales/common/zh-CN.json +++ b/locales/common/zh-CN.json @@ -15,6 +15,9 @@ "words.items": "内容", "words.items_one": "内容", "words.items_other": "内容", + "words.local": "本地", + "words.record": "记录", + "words.result": "结果", "words.space": "", "words.which.all": "全部" } diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 66cf47942..ad4d70343 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -53,8 +53,8 @@ "appearance.guess_code_language.description": "使用模型来推断未标记代码块的主要编程语言", "appearance.guess_code_language.label": "猜测代码语言", "appearance.misc": "杂项", - "appearance.modal_overlay.description": "显示模态叠加", - "appearance.modal_overlay.label": "显示模态叠加", + "appearance.modal_overlay.description": "显示模态遮罩,以提高可访问性", + "appearance.modal_overlay.label": "显示模态遮罩", "appearance.opaque_sidebars.label": "不透明侧边栏", "appearance.reader_render_inline_style.description": "允许渲染原始 HTML 的内联样式。", "appearance.reader_render_inline_style.label": "渲染内联样式", diff --git a/package.json b/package.json index e2c407033..fce3c0cf4 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "electron-updater": "^6.3.4", "font-list": "1.5.1", "foxact": "0.2.38", - "framer-motion": "11.0.10", + "framer-motion": "11.5.4", "franc-min": "6.2.0", "fuse.js": "7.0.0", "hast-util-to-jsx-runtime": "2.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 718f46e32..7c3c9e949 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -195,8 +195,8 @@ importers: specifier: 0.2.38 version: 0.2.38(react@18.3.1) framer-motion: - specifier: 11.0.10 - version: 11.0.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 11.5.4 + version: 11.5.4(@emotion/is-prop-valid@0.8.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) franc-min: specifier: 6.2.0 version: 6.2.0 @@ -4999,12 +4999,15 @@ packages: react: optional: true - framer-motion@11.0.10: - resolution: {integrity: sha512-aaImib9FQlfno2yiZAdkvN6zLXLr8a9uGsGFlQO64hSm8NoCeiUng2//5ok7RHCW2ufzT74uuPsmWzUsrHPYDQ==} + framer-motion@11.5.4: + resolution: {integrity: sha512-E+tb3/G6SO69POkdJT+3EpdMuhmtCh9EWuK4I1DnIC23L7tFPrl8vxP+LSovwaw6uUr73rUbpb4FgK011wbRJQ==} peerDependencies: + '@emotion/is-prop-valid': '*' react: ^18.0.0 react-dom: ^18.0.0 peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true react: optional: true react-dom: @@ -13937,7 +13940,7 @@ snapshots: optionalDependencies: react: 18.3.1 - framer-motion@11.0.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + framer-motion@11.5.4(@emotion/is-prop-valid@0.8.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: tslib: 2.7.0 optionalDependencies: diff --git a/src/renderer/src/components/ui/modal/stacked/modal.tsx b/src/renderer/src/components/ui/modal/stacked/modal.tsx index 9458efb3d..183624023 100644 --- a/src/renderer/src/components/ui/modal/stacked/modal.tsx +++ b/src/renderer/src/components/ui/modal/stacked/modal.tsx @@ -113,7 +113,7 @@ export const ModalInternal = memo( }) const animateController = useAnimationControls() useEffect(() => { - requestAnimationFrame(() => { + nextFrame(() => { animateController.start(modalMontionConfig.animate) }) }, [animateController]) @@ -259,6 +259,7 @@ export const ModalInternal = memo( )} onPointerUp={handleDetectSelectEnd} onClick={handleClickOutsideToDismiss} + onFocus={stopPropagation} style={zIndexStyle} > {DragBar} @@ -296,6 +297,7 @@ export const ModalInternal = memo( modalContainerClassName, !isResizeable && "center", )} + onFocus={stopPropagation} onPointerUp={handleDetectSelectEnd} onClick={handleClickOutsideToDismiss} > diff --git a/src/renderer/src/hooks/common/index.ts b/src/renderer/src/hooks/common/index.ts index 24d38568b..5331c8bfb 100644 --- a/src/renderer/src/hooks/common/index.ts +++ b/src/renderer/src/hooks/common/index.ts @@ -1,5 +1,6 @@ export * from "./useBizQuery" export * from "./useDark" +export * from "./useI18n" export * from "./useInputComposition" export * from "./useInterval" export * from "./useIsOnline" diff --git a/src/renderer/src/hooks/common/useI18n.ts b/src/renderer/src/hooks/common/useI18n.ts new file mode 100644 index 000000000..9d8af18bd --- /dev/null +++ b/src/renderer/src/hooks/common/useI18n.ts @@ -0,0 +1,23 @@ +import { ns } from "@renderer/@types/constants" +import { useMemo } from "react" +import type { FallbackNs, UseTranslationResponse } from "react-i18next" +import { useTranslation } from "react-i18next" + +const allNameSpaces = ns + +export function useI18n() { + const { t } = useTranslation() + + return useMemo(() => { + const clonedT = t.bind(t) + + for (const ns of allNameSpaces) { + clonedT[ns] = (key: any, options: Omit[1], "ns"> = {}) => { + return t(key, { ns: ns as any, ...options }) + } + } + return clonedT as typeof t & { + [K in (typeof allNameSpaces)[number]]: UseTranslationResponse, undefined>["t"] + } + }, [t]) +} diff --git a/src/renderer/src/lib/utils.ts b/src/renderer/src/lib/utils.ts index 7eea3e870..5135ba772 100644 --- a/src/renderer/src/lib/utils.ts +++ b/src/renderer/src/lib/utils.ts @@ -145,6 +145,9 @@ export const sleep = (ms: number) => new Promise((resolve) => setTimeout(r export const capitalizeFirstLetter = (string: string) => string.charAt(0).toUpperCase() + string.slice(1) +/** + * @deprecated + */ export const pluralize = ( noun: string, count: number, diff --git a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx index e2119ade9..dbc0690ff 100644 --- a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx +++ b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx @@ -5,6 +5,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@renderer/components/ui import { RootPortal } from "@renderer/components/ui/portal" import { HotKeyScopeMap } from "@renderer/constants" import { shortcuts } from "@renderer/constants/shortcuts" +import { useI18n } from "@renderer/hooks/common" import { cn } from "@renderer/lib/utils" import { AnimatePresence, m } from "framer-motion" import type { FC, ReactNode } from "react" @@ -235,8 +236,8 @@ export const MarkAllReadPopover = forwardRef = (props) => { - const { t } = useTranslation() - const { t: commonT } = useTranslation("common") + const t = useI18n() + const { className, filter, which } = props const [status, setStatus] = useState<"initial" | "confirm" | "done">("initial") const handleMarkAll = useMarkAllByRoute(filter) @@ -278,9 +279,7 @@ export const FlatMarkAllReadButton: FC = (props) => { diff --git a/src/renderer/src/modules/panel/cmdk.tsx b/src/renderer/src/modules/panel/cmdk.tsx index 5c5ba03d9..6d056b271 100644 --- a/src/renderer/src/modules/panel/cmdk.tsx +++ b/src/renderer/src/modules/panel/cmdk.tsx @@ -15,8 +15,9 @@ import { import { Tooltip, TooltipContent, TooltipTrigger } from "@renderer/components/ui/tooltip" import { ROUTE_ENTRY_PENDING } from "@renderer/constants" import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry" +import { useI18n } from "@renderer/hooks/common" import type { FeedViewType } from "@renderer/lib/enum" -import { cn, pluralize } from "@renderer/lib/utils" +import { cn } from "@renderer/lib/utils" import { getFeedById } from "@renderer/store/feed" import { searchActions, useSearchStore } from "@renderer/store/search" import { SearchType } from "@renderer/store/search/constants" @@ -28,11 +29,13 @@ import { Command } from "cmdk" import type { FC } from "react" import * as React from "react" import { memo, useMemo } from "react" +import { useTranslation } from "react-i18next" import styles from "./cmdk.module.css" const SearchCmdKContext = React.createContext | null>(null) export const SearchCmdK: React.FC = () => { + const { t } = useTranslation() const open = useAppSearchOpen() const [searchInstance, setSearchInstance] = React.useState(() => @@ -134,7 +137,7 @@ export const SearchCmdK: React.FC = () => {
@@ -150,7 +153,12 @@ export const SearchCmdK: React.FC = () => { {renderedEntries.length > 0 && ( } + heading={ + + } className="flex w-full min-w-0 flex-col py-2" > {renderedEntries.map((entry) => { @@ -173,7 +181,10 @@ export const SearchCmdK: React.FC = () => { {renderedFeeds.length > 0 && ( + } className="py-2" > @@ -264,10 +275,11 @@ const SearchGroupHeading: FC<{ icon: string; title: string }> = ({ icon, title } const SearchResultCount: FC<{ count?: number }> = ({ count }) => { + const t = useI18n() const searchInstance = React.useContext(SearchCmdKContext) const hasKeyword = useSearchStore((s) => !!s.keyword) const searchType = useSearchStore((s) => s.searchType) - + const recordCountPromise = useMemo(async () => { let count = 0 const counts = await searchInstance?.then((s) => s.counts) @@ -290,35 +302,37 @@ const SearchResultCount: FC<{ {hasKeyword ? ( - {count} {pluralize("result", count || 0)} + {count} {t.common("words.result", { count })} ) : ( {(count) => ( <> - {count} local {pluralize("record", count)} + {count} {t.common("quantifier.piece")} + {t.common("words.local")} + {t.common("words.space")} + {t.common("words.record", { count })} )} )}{" "} - (Local mode) + {t("search.result_count_local_mode")} - - This search covers locally available data. Try a Refetch to include the latest data. - + {t("search.tooltip.local_search")} ) } const SearchOptions: Component = memo(({ children }) => { + const { t } = useTranslation() const searchType = useSearchStore((s) => s.searchType) const searchInstance = React.useContext(SearchCmdKContext) return (
- Search Type + {t("search.options.search_type")} @@ -365,13 +379,14 @@ const SearchOptions: Component = memo(({ children }) => { }) const SearchPlaceholder = () => { + const { t } = useTranslation() const hasKeyword = useSearchStore((s) => !!s.keyword) return ( {hasKeyword ? (
- No results found. + {t("search.empty.no_results")}
) : ( diff --git a/src/renderer/src/modules/profile/user-profile-modal.tsx b/src/renderer/src/modules/profile/user-profile-modal.tsx index 7dd46ef2f..0d36ffec5 100644 --- a/src/renderer/src/modules/profile/user-profile-modal.tsx +++ b/src/renderer/src/modules/profile/user-profile-modal.tsx @@ -7,7 +7,7 @@ import { ActionButton, Button } from "@renderer/components/ui/button" import { LoadingCircle, LoadingWithIcon } from "@renderer/components/ui/loading" import { useCurrentModal, useModalStack } from "@renderer/components/ui/modal" import { ScrollArea } from "@renderer/components/ui/scroll-area" -import { useAuthQuery } from "@renderer/hooks/common" +import { useAuthQuery, useI18n } from "@renderer/hooks/common" import { apiClient } from "@renderer/lib/api-fetch" import { defineQuery } from "@renderer/lib/defineQuery" import { nextFrame, stopPropagation } from "@renderer/lib/dom" @@ -23,6 +23,7 @@ import { atomWithStorage } from "jotai/utils" import { throttle } from "lodash-es" import type { FC } from "react" import { Fragment, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { FeedForm } from "../discover/feed-form" @@ -40,6 +41,7 @@ export const UserProfileModalContent: FC<{ variant: "drawer" | "dialog" }> = ({ userId, variant }) => { + const { t } = useTranslation() const user = useAuthQuery( defineQuery(["profiles", userId], async () => { const res = await apiClient.profiles.$get({ @@ -171,7 +173,6 @@ export const UserProfileModalContent: FC<{ >
{ const currentVisible = currentVisibleRef.current const topOfCurrent = currentVisible?.values().next().value @@ -213,14 +214,14 @@ export const UserProfileModalContent: FC<{ /> { window.open(`${env.VITE_WEB_URL}/profile/${user.data?.id}`) }} > - +
@@ -267,7 +268,7 @@ export const UserProfileModalContent: FC<{ @@ -325,6 +326,7 @@ const SubscriptionItem: FC<{ variant: ItemVariant }> = ({ subscription, variant }) => { + const t = useI18n() const isFollowed = !!useSubscriptionStore((state) => state.data[subscription.feedId]) const { present } = useModalStack() const isLoose = variant === "loose" @@ -354,10 +356,11 @@ const SubscriptionItem: FC<{ onClick={(e) => { e.stopPropagation() e.preventDefault() + const defaultView = subscription.view present({ - title: `${isFollowed ? "Edit " : ""}${APP_NAME} - ${subscription.feeds.title}`, + title: `${isFollowed ? `${t.common("words.edit")} ` : ""}${APP_NAME} - ${subscription.feeds.title}`, clickOutsideToDismiss: true, content: ({ dismiss }) => ( {isFollowed ? ( - "Edit" + t("user_profile.edit") ) : ( <> diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index 61086b8fc..a336c7689 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -8,6 +8,7 @@ import { getGeneralSettings } from "@renderer/atoms/settings/general" import { i18nAtom } from "@renderer/i18n" import { EventBus } from "@renderer/lib/event-bus" import { jotaiStore } from "@renderer/lib/jotai" +import { isEmptyObject } from "@renderer/lib/utils" import dayjs from "dayjs" import i18next from "i18next" import { useAtom } from "jotai" @@ -67,8 +68,17 @@ const langChangedHandler = async (lang: string) => { } } } else { - const res = await eval(`import('/locales/${lang}.js').then((res) => res?.default || res)`) + const res = await eval( + `import('/locales/${lang}.js').then((res) => res?.default || res)`, + ).catch(() => { + toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) + loadingLangLock.delete(lang) + return {} + }) + if (isEmptyObject(res)) { + return + } for (const namespace in res) { i18next.addResourceBundle(lang, namespace, res[namespace], true, true) } diff --git a/tsconfig.node.json b/tsconfig.node.json index 30a7f1684..4203d84c0 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -17,6 +17,8 @@ "types": ["electron-vite/node"], "moduleResolution": "Bundler", "noImplicitReturns": false, + "noUnusedLocals": false, + "noUnusedParameters": false, "baseUrl": ".", "paths": { "@shared/*": ["src/shared/src/*"], From bf7da0431fdffc45cf0136b9e5709bb1952f1036 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 22:01:02 +0800 Subject: [PATCH 09/66] feat: language indicator Signed-off-by: Innei --- configs/i18n-completeness.ts | 60 ++++++++++++++++++ configs/vite.render.config.ts | 3 + locales/app/en.json | 3 + locales/app/zh-CN.json | 3 + locales/common/en.json | 1 + locales/common/ja.json | 28 +++++++++ locales/common/zh-CN.json | 1 + locales/lang/en.json | 3 +- locales/lang/ja.json | 6 ++ locales/lang/zh-CN.json | 5 +- src/renderer/src/@types/constants.ts | 11 +--- src/renderer/src/@types/default-resource.ts | 6 ++ src/renderer/src/env.d.ts | 1 + .../components/mark-all-button.tsx | 61 ------------------- .../src/modules/feed-column/header.tsx | 10 +-- .../src/modules/settings/tabs/general.tsx | 15 +++-- tsconfig.node.json | 2 +- 17 files changed, 136 insertions(+), 83 deletions(-) create mode 100644 configs/i18n-completeness.ts create mode 100644 locales/common/ja.json create mode 100644 locales/lang/ja.json diff --git a/configs/i18n-completeness.ts b/configs/i18n-completeness.ts new file mode 100644 index 000000000..3de328b31 --- /dev/null +++ b/configs/i18n-completeness.ts @@ -0,0 +1,60 @@ +import fs from "node:fs" +import path from "node:path" + +type LanguageCompletion = Record + +function getLanguageFiles(dir: string): string[] { + return fs.readdirSync(dir).filter((file) => file.endsWith(".json")) +} + +function getNamespaces(localesDir: string): string[] { + return fs + .readdirSync(localesDir) + .filter((file) => fs.statSync(path.join(localesDir, file)).isDirectory()) +} + +function countKeys(obj: any): number { + let count = 0 + for (const key in obj) { + if (typeof obj[key] === "object") { + count += countKeys(obj[key]) + } else { + count++ + } + } + return count +} + +function calculateCompleteness(localesDir: string): LanguageCompletion { + const namespaces = getNamespaces(localesDir) + const languages = new Set() + const keyCount: Record = {} + + namespaces.forEach((namespace) => { + const namespaceDir = path.join(localesDir, namespace) + const files = getLanguageFiles(namespaceDir) + + files.forEach((file) => { + const lang = path.basename(file, ".json") + languages.add(lang) + + const content = JSON.parse(fs.readFileSync(path.join(namespaceDir, file), "utf-8")) + keyCount[lang] = (keyCount[lang] || 0) + countKeys(content) + }) + }) + + const enCount = keyCount["en"] || 0 + const completeness: LanguageCompletion = {} + + languages.forEach((lang) => { + if (lang !== "en") { + const percent = Math.round((keyCount[lang] / enCount) * 100) + completeness[lang] = percent + } + }) + + return completeness +} + +const i18n = calculateCompleteness(path.resolve(__dirname, "../locales")) +export default i18n diff --git a/configs/vite.render.config.ts b/configs/vite.render.config.ts index 36dd7d4f3..8dfb9747b 100644 --- a/configs/vite.render.config.ts +++ b/configs/vite.render.config.ts @@ -11,6 +11,7 @@ import { prerelease } from "semver" import type { Plugin, UserConfig } from "vite" import { getGitHash } from "../scripts/lib" +import i18nCompleteness from "./i18n-completeness" const pkg = JSON.parse(readFileSync("package.json", "utf8")) const isCI = process.env.CI === "true" || process.env.CI === "1" @@ -134,6 +135,8 @@ export const viteRenderBaseConfig = { RELEASE_CHANNEL: JSON.stringify((prerelease(pkg.version)?.[0] as string) || "stable"), DEBUG: process.env.DEBUG === "true", + + I18N_COMPLETENESS_MAP: JSON.stringify({ ...i18nCompleteness, en: 100 }), }, } satisfies UserConfig diff --git a/locales/app/en.json b/locales/app/en.json index 18249e9ef..fe3cc71a9 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -2,6 +2,9 @@ "ai_daily.title": "Top News - {{title}}", "ai_daily.tooltip.content": "Here is news selected by AI from your timeline ( - ) that may be important to you.", "ai_daily.tooltip.update_schedule": "Update daily at 8 AM and 8 PM.", + "app.app_name": "APP_NAME", + "app.copy_logo_svg": "Copy Logo SVG", + "app.toggle_sidebar": "Toggle Sidebar", "discover.any_url_or_keyword": "Any URL or Keyword", "discover.default_option": " (default)", "discover.feed_description": "The description of this feed is as follows, and you can fill out the parameter form with the relevant information.", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 8e9f43af6..60bbaab6e 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -2,6 +2,9 @@ "ai_daily.title": "头条 - {{title}}", "ai_daily.tooltip.content": "这里是通过 AI 从您的时间线中选择的头条新闻( - ),可能对您很重要。", "ai_daily.tooltip.update_schedule": "每天早上 8 点、晚上 8 点更新。", + "app.app_name": "APP_NAME", + "app.copy_logo_svg": "复制 Logo SVG", + "app.toggle_sidebar": "切换侧边栏", "discover.any_url_or_keyword": "任何 URL 或关键词", "discover.default_option": " (默认)", "discover.feed_description": "此 Feed 的描述如下,您可以填写相关信息。", diff --git a/locales/common/en.json b/locales/common/en.json index 5350e008e..70164b71b 100644 --- a/locales/common/en.json +++ b/locales/common/en.json @@ -1,4 +1,5 @@ { + "app.copied_to_clipboard": "Copied to clipboard", "cancel": "Cancel", "confirm": "Confirm", "ok": "OK", diff --git a/locales/common/ja.json b/locales/common/ja.json new file mode 100644 index 000000000..14fb7935e --- /dev/null +++ b/locales/common/ja.json @@ -0,0 +1,28 @@ +{ + "app.copied_to_clipboard": "クリップボードにコピーしました", + "cancel": "キャンセル", + "confirm": "確認", + "ok": "OK", + "quantifier.piece": "個", + "time.last_night": "昨夜", + "time.the_night_before_last": "一昨夜", + "time.today": "今日", + "time.yesterday": "昨日", + "tips.load-lng-error": "言語パックの読み込みに失敗しました", + "words.back": "戻る", + "words.copy": "コピー", + "words.edit": "編集", + "words.entry": "エントリー", + "words.id": "ID", + "words.items_one": "アイテム", + "words.items_other": "アイテム", + "words.local": "ローカル", + "words.record": "記録", + "words.record_one": "記録", + "words.record_other": "記録", + "words.result": "結果", + "words.result_one": "結果", + "words.result_other": "結果", + "words.space": "", + "words.which.all": "すべて" +} diff --git a/locales/common/zh-CN.json b/locales/common/zh-CN.json index 9d94f3309..d68419a69 100644 --- a/locales/common/zh-CN.json +++ b/locales/common/zh-CN.json @@ -1,4 +1,5 @@ { + "app.copied_to_clipboard": "已复制到剪贴板", "cancel": "取消", "confirm": "确认", "ok": "好", diff --git a/locales/lang/en.json b/locales/lang/en.json index e6f2d29f5..795047911 100644 --- a/locales/lang/en.json +++ b/locales/lang/en.json @@ -1,5 +1,6 @@ { "langs.en": "English", - "langs.zh-CN": "简体中文(部分完成)", + "langs.ja": "日本語", + "langs.zh-CN": "简体中文", "name": "English" } diff --git a/locales/lang/ja.json b/locales/lang/ja.json new file mode 100644 index 000000000..cdd1c6e6c --- /dev/null +++ b/locales/lang/ja.json @@ -0,0 +1,6 @@ +{ + "langs.en": "English", + "langs.ja": "日本語", + "langs.zh-CN": "简体中文", + "name": "日本語" +} diff --git a/locales/lang/zh-CN.json b/locales/lang/zh-CN.json index e6f2d29f5..48ce191a7 100644 --- a/locales/lang/zh-CN.json +++ b/locales/lang/zh-CN.json @@ -1,5 +1,6 @@ { "langs.en": "English", - "langs.zh-CN": "简体中文(部分完成)", - "name": "English" + "langs.ja": "日本語", + "langs.zh-CN": "简体中文", + "name": "简体中文" } diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index f6bac9017..94c2bebd3 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -1,16 +1,9 @@ -export const currentSupportedLanguages = (() => { - const langsFiles = import.meta.glob("../../../../locales/app/*.json") - - const langs = [] as string[] - for (const key in langsFiles) { - langs.push(key.split("/").pop()?.replace(".json", "") as string) - } - return langs -})() +export const currentSupportedLanguages = ["en", "ja", "zh-CN"] export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], ["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")], + ["ja"]: ["ja", () => import("dayjs/locale/ja")], } export const ns = ["app", "common", "lang", "settings", "shortcuts"] as const diff --git a/src/renderer/src/@types/default-resource.ts b/src/renderer/src/@types/default-resource.ts index 51ddc8165..28c271ac8 100644 --- a/src/renderer/src/@types/default-resource.ts +++ b/src/renderer/src/@types/default-resource.ts @@ -1,8 +1,10 @@ import en from "../../../../locales/app/en.json" import common_en from "../../../../locales/common/en.json" +import common_ja from "../../../../locales/common/ja.json" import common_zhCN from "../../../../locales/common/zh-CN.json" import external_en from "../../../../locales/external/en.json" import lang_en from "../../../../locales/lang/en.json" +import lang_ja from "../../../../locales/lang/ja.json" import lang_zhCN from "../../../../locales/lang/zh-CN.json" import settings_en from "../../../../locales/settings/en.json" import shortcuts_en from "../../../../locales/shortcuts/en.json" @@ -28,4 +30,8 @@ export const defaultResources = { lang: lang_zhCN, common: common_zhCN, }, + ja: { + lang: lang_ja, + common: common_ja, + }, } diff --git a/src/renderer/src/env.d.ts b/src/renderer/src/env.d.ts index 6db251e83..06142aad0 100644 --- a/src/renderer/src/env.d.ts +++ b/src/renderer/src/env.d.ts @@ -2,3 +2,4 @@ declare const APP_VERSION: string declare const APP_NAME: string declare const RELEASE_CHANNEL: string +declare const I18N_COMPLETENESS_MAP: Record diff --git a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx index dbc0690ff..1917030b2 100644 --- a/src/renderer/src/modules/entry-column/components/mark-all-button.tsx +++ b/src/renderer/src/modules/entry-column/components/mark-all-button.tsx @@ -1,7 +1,5 @@ -import { PopoverPortal } from "@radix-ui/react-popover" import { ActionButton, Button, IconButton } from "@renderer/components/ui/button" import { Kbd, KbdCombined } from "@renderer/components/ui/kbd/Kbd" -import { Popover, PopoverContent, PopoverTrigger } from "@renderer/components/ui/popover" import { RootPortal } from "@renderer/components/ui/portal" import { HotKeyScopeMap } from "@renderer/constants" import { shortcuts } from "@renderer/constants/shortcuts" @@ -176,65 +174,6 @@ const ConfirmMarkAllReadInfo = ({ undo }: { undo: () => any }) => { ) } -/** - * @deprecated - */ -export const MarkAllReadPopover = forwardRef( - ({ filter, className, which = "all", shortcut }, ref) => { - const [markPopoverOpen, setMarkPopoverOpen] = useState(false) - - const handleMarkAllAsRead = useMarkAllByRoute(filter) - - return ( - - - - Mark - - {which} - - as read - - } - className={className} - ref={ref} - > - - - - - -
- -
-
- } - onClick={() => { - handleMarkAllAsRead() - setMarkPopoverOpen(false) - }} - > - Confirm - -
-
-
-
- ) - }, -) - export const FlatMarkAllReadButton: FC = (props) => { const t = useI18n() diff --git a/src/renderer/src/modules/feed-column/header.tsx b/src/renderer/src/modules/feed-column/header.tsx index dcdbd90a1..ff75cc2e1 100644 --- a/src/renderer/src/modules/feed-column/header.tsx +++ b/src/renderer/src/modules/feed-column/header.tsx @@ -6,6 +6,7 @@ import { ActionButton } from "@renderer/components/ui/button" import { Popover, PopoverContent, PopoverTrigger } from "@renderer/components/ui/popover" import { ProfileButton } from "@renderer/components/user-button" import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry" +import { useI18n } from "@renderer/hooks/common" import { stopPropagation } from "@renderer/lib/dom" import { cn } from "@renderer/lib/utils" import { m } from "framer-motion" @@ -53,7 +54,6 @@ export const FeedColumnHeader = memo(() => { }} > - {APP_NAME}
@@ -80,10 +80,11 @@ const LayoutActionButton = () => { width: !feedColumnShow ? "auto" : 0, }) + const t = useI18n() return ( { const LogoContextMenu: FC = ({ children }) => { const [open, setOpen] = useState(false) const logoRef = useRef(null) + const t = useI18n() return ( @@ -120,7 +122,7 @@ const LogoContextMenu: FC = ({ children }) => { onClick={() => { navigator.clipboard.writeText(logoRef.current?.outerHTML || "") setOpen(false) - toast.success("Copied to clipboard") + toast.success(t.common("app.copied_to_clipboard")) }} className={cn( "relative flex cursor-default select-none items-center rounded-sm px-1 py-0.5 text-sm outline-none", @@ -129,7 +131,7 @@ const LogoContextMenu: FC = ({ children }) => { )} > - Copy Logo SVG + {t("app.copy_logo_svg")} diff --git a/src/renderer/src/modules/settings/tabs/general.tsx b/src/renderer/src/modules/settings/tabs/general.tsx index 0025fa0e3..de7ed2e76 100644 --- a/src/renderer/src/modules/settings/tabs/general.tsx +++ b/src/renderer/src/modules/settings/tabs/general.tsx @@ -221,11 +221,16 @@ export const LanguageSelector = () => { - {currentSupportedLanguages.map((lang) => ( - - {langT(`langs.${lang}` as any)} - - ))} + {currentSupportedLanguages.map((lang) => { + const percent = I18N_COMPLETENESS_MAP[lang] + + return ( + + {langT(`langs.${lang}` as any)}{" "} + {typeof percent === "number" ? (percent === 100 ? null : `(${percent}%)`) : null} + + ) + })}
diff --git a/tsconfig.node.json b/tsconfig.node.json index 4203d84c0..35ccca4e3 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -9,7 +9,7 @@ "src/env.ts", "./src/hono.ts", "src/shared/src/global.d.ts", - "configs/vite.render.config.ts", + "configs/*", "./scripts/**/*" ], "compilerOptions": { From 6f8acced7bc51d2bb22325506e1c9bc97ee963f7 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 22:20:34 +0800 Subject: [PATCH 10/66] feat: more i18n text Signed-off-by: Innei --- locales/app/en.json | 7 +++++ src/renderer/src/@types/constants.ts | 2 +- src/renderer/src/components/user-button.tsx | 26 +++++++------------ .../src/modules/entry-column/lists.tsx | 2 +- .../src/modules/entry-content/header.tsx | 7 +++-- src/renderer/src/modules/feed-column/item.tsx | 16 +++++++----- src/renderer/src/modules/modal/shortcuts.tsx | 2 +- 7 files changed, 34 insertions(+), 28 deletions(-) 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" })} From 1852d1ee812567c473ff26d316b93d1ccf8e8a88 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 13 Sep 2024 22:29:47 +0800 Subject: [PATCH 11/66] fix: wtf, cursor deleted my code Signed-off-by: Innei --- locales/app/en.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/locales/app/en.json b/locales/app/en.json index 9e5f5a1a2..64dd9a6e2 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -30,11 +30,14 @@ "entry_column.refreshing": "Refreshing new entries...", "entry_content.ai_summary": "AI summary", "entry_content.fetching_content": "Fetching original content and processing...", + "entry_content.header.play_tts": "Play TTS", + "entry_content.header.readability": "Readability", "entry_content.no_content": "No content", "entry_content.readability_notice": "This content is provided by Readability. If you find typographical anomalies, please go to the source site to view the original content.", "entry_content.render_error": "Render error:", "entry_content.report_issue": "Report issue", "entry_content.web_app_notice": "Maybe web app doesn't support this content type. But you can download the desktop app.", + "entry_list.zero_unread": "Zero Unread", "entry_list_header.daily_report": "Daily Report", "entry_list_header.items": "items", "entry_list_header.new_entries_available": "New entries available", @@ -63,6 +66,12 @@ "feed_form.update_follow": "Update follow", "feed_form.updated": "🎉 Updated.", "feed_form.view": "View", + "feed_item.claimed_by_owner": "This feed is claimed by", + "feed_item.claimed_by_unknown": "its owner.", + "feed_item.claimed_by_you": "Claimed by you", + "feed_item.claimed_feed": "Claimed Feed", + "feed_item.error_since": "Error since", + "feed_item.not_publicly_visible": "Not publicly visible on your profile page", "feed_view_type.articles": "Articles", "feed_view_type.audios": "Audios", "feed_view_type.notifications": "Notifications", From 425b8c3003b552215350d534640e18512e9d819b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 13 Sep 2024 22:52:01 +0800 Subject: [PATCH 12/66] feat: display feed certification in discover result --- src/hono.ts | 9 + .../src/components/feed-certification.tsx | 73 +++++++ src/renderer/src/components/feed-summary.tsx | 6 +- src/renderer/src/modules/discover/form.tsx | 178 +++++++++--------- src/renderer/src/modules/feed-column/item.tsx | 57 +----- 5 files changed, 177 insertions(+), 146 deletions(-) create mode 100644 src/renderer/src/components/feed-certification.tsx diff --git a/src/hono.ts b/src/hono.ts index ed8b269d1..aeb295f7a 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -5283,6 +5283,15 @@ declare const _routes: hono_hono_base.HonoBase< errorMessage: string | null errorAt: string | null ownerUserId: string | null + owner: { + name: string | null + id: string + email: string + emailVerified: string | null + image: string | null + handle: string | null + createdAt: string + } | null } entries?: | { diff --git a/src/renderer/src/components/feed-certification.tsx b/src/renderer/src/components/feed-certification.tsx new file mode 100644 index 000000000..a2d8b04ac --- /dev/null +++ b/src/renderer/src/components/feed-certification.tsx @@ -0,0 +1,73 @@ +import { useWhoami } from "@renderer/atoms/user" +import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar" +import { + Tooltip, + TooltipContent, + TooltipPortal, + TooltipTrigger, +} from "@renderer/components/ui/tooltip" +import { cn } from "@renderer/lib/utils" +import type { FeedModel } from "@renderer/models" +import { usePresentUserProfileModal } from "@renderer/modules/profile/hooks" +import { useTranslation } from "react-i18next" + +export const FeedCertification = ({ feed, className }: { feed: FeedModel; className?: string }) => { + const me = useWhoami() + const presentUserProfile = usePresentUserProfileModal("drawer") + const { t } = useTranslation() + + return ( + feed.ownerUserId && + (feed.ownerUserId === me?.id ? ( + + + + + + + +
+ + {t("feed_item.claimed_feed")} +
+
{t("feed_item.claimed_by_you")}
+
+
+
+ ) : ( + + + + + + + +
+ + {t("feed_item.claimed_feed")} +
+
+ {t("feed_item.claimed_by_owner")} + {feed.owner ? ( + { + e.stopPropagation() + presentUserProfile(feed.owner!.id) + }} + > + + {feed.owner.name?.slice(0, 2)} + + ) : ( + {t("feed_item.claimed_by_unknown")} + )} +
+
+
+
+ )) + ) +} diff --git a/src/renderer/src/components/feed-summary.tsx b/src/renderer/src/components/feed-summary.tsx index b7477bf94..3c628733b 100644 --- a/src/renderer/src/components/feed-summary.tsx +++ b/src/renderer/src/components/feed-summary.tsx @@ -2,6 +2,7 @@ import { FeedIcon } from "@renderer/components/feed-icon" import { cn } from "@renderer/lib/utils" import type { FeedModel } from "@renderer/models" +import { FeedCertification } from "./feed-certification" import { EllipsisHorizontalTextWithTooltip } from "./ui/typography" export function FollowSummary({ @@ -28,7 +29,10 @@ export function FollowSummary({ size={32} />
- {feed.title} +
+ {feed.title} + +
{feed.description} diff --git a/src/renderer/src/modules/discover/form.tsx b/src/renderer/src/modules/discover/form.tsx index 609c200d1..83994410f 100644 --- a/src/renderer/src/modules/discover/form.tsx +++ b/src/renderer/src/modules/discover/form.tsx @@ -144,99 +144,97 @@ export function DiscoverForm({ type }: { type: string }) { {mutation.data?.length > 1 && "s"}
- {mutation.data - ?.sort((a, b) => (b.subscriptionCount ?? 0) - (a.subscriptionCount ?? 0)) - .map((item) => ( - - - - - {item.docs ? ( - - - - - - ) : ( - <> - - {!!item.entries?.length && ( -
- {item.entries - .filter((e) => !!e) - .map((entry) => { - const assertEntry = entry - return ( - - {assertEntry.media?.[0] ? ( - - ) : ( -
- {assertEntry.title} -
- )} -
+ {mutation.data.map((item) => ( + + + + + {item.docs ? ( + + + + + + ) : ( + <> + + {!!item.entries?.length && ( +
+ {item.entries + .filter((e) => !!e) + .map((entry) => { + const assertEntry = entry + return ( + + {assertEntry.media?.[0] ? ( + + ) : ( +
{assertEntry.title}
-
- ) - })} -
- )} -
- - {item.isSubscribed ? ( - - ) : ( - - )} -
- - {item.subscriptionCount} - {" "} - Followers + )} +
+ {assertEntry.title} +
+ + ) + })}
-
- - )} - - ))} + )} + + + {item.isSubscribed ? ( + + ) : ( + + )} +
+ + {item.subscriptionCount} + {" "} + Followers +
+
+ + )} + + ))}
)} diff --git a/src/renderer/src/modules/feed-column/item.tsx b/src/renderer/src/modules/feed-column/item.tsx index 6ffce7118..fa5f1ab01 100644 --- a/src/renderer/src/modules/feed-column/item.tsx +++ b/src/renderer/src/modules/feed-column/item.tsx @@ -1,8 +1,7 @@ import { getMainContainerElement } from "@renderer/atoms/dom" -import { useWhoami } from "@renderer/atoms/user" +import { FeedCertification } from "@renderer/components/feed-certification" import { FeedIcon } from "@renderer/components/feed-icon" import { OouiUserAnonymous } from "@renderer/components/icons/OouiUserAnonymous" -import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar" import { Tooltip, TooltipContent, @@ -24,7 +23,6 @@ import dayjs from "dayjs" import { memo, useCallback } from "react" import { useTranslation } from "react-i18next" -import { usePresentUserProfileModal } from "../profile/hooks" import { UnreadNumber } from "./unread-number" interface FeedItemProps { @@ -61,8 +59,6 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI const feed = useFeedById(feedId) const { items } = useFeedActions({ feedId, view }) - const me = useWhoami() - const presentUserProfile = usePresentUserProfileModal("drawer") if (!feed) return null @@ -122,56 +118,7 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI > {getPreferredTitle(feed)}
- {feed.ownerUserId && - (feed.ownerUserId === me?.id ? ( - - - - - - - -
- - {t("feed_item.claimed_feed")} -
-
{t("feed_item.claimed_by_you")}
-
-
-
- ) : ( - - - - - - - -
- - {t("feed_item.claimed_feed")} -
-
- {t("feed_item.claimed_by_owner")} - {feed.owner ? ( - { - e.stopPropagation() - presentUserProfile(feed.owner!.id) - }} - > - - {feed.owner.name?.slice(0, 2)} - - ) : ( - {t("feed_item.claimed_by_unknown")} - )} -
-
-
-
- ))} + {feed.errorAt && ( From 5e8fb17f4a849abd755d92d32d3e5e1a76a2d2ab Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 14 Sep 2024 02:46:11 +0800 Subject: [PATCH 13/66] feat: add readability action rules --- locales/settings/en.json | 1 + src/hono.ts | 16 ++++++++++++++++ src/renderer/src/modules/entry-content/index.tsx | 8 ++++++++ .../src/modules/settings/action-card.tsx | 14 ++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/locales/settings/en.json b/locales/settings/en.json index 04f69a274..afb4d62eb 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -10,6 +10,7 @@ "actions.action_card.all": "All", "actions.action_card.block_rules": "Block Rules", "actions.action_card.custom_filters": "Custom filters", + "actions.action_card.enable_readability": "Enable readability", "actions.action_card.entry_options.all": "All", "actions.action_card.entry_options.author": "Author", "actions.action_card.entry_options.content": "Content", diff --git a/src/hono.ts b/src/hono.ts index aeb295f7a..bb2b2db91 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -59,6 +59,7 @@ declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{ result: { translation?: z.infer summary?: boolean + readability?: boolean rewriteRules?: { from: string to: string @@ -115,6 +116,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { translation: z.ZodOptional> summary: z.ZodOptional + readability: z.ZodOptional rewriteRules: z.ZodOptional< z.ZodArray< z.ZodObject< @@ -168,6 +170,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -185,6 +188,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -213,6 +217,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -238,6 +243,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -652,6 +658,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { translation: z.ZodOptional> summary: z.ZodOptional + readability: z.ZodOptional rewriteRules: z.ZodOptional< z.ZodArray< z.ZodObject< @@ -719,6 +726,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -743,6 +751,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -778,6 +787,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -810,6 +820,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -854,6 +865,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -885,6 +897,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5117,6 +5130,7 @@ declare const _routes: hono_hono_base.HonoBase< | { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5571,6 +5585,7 @@ declare const _routes: hono_hono_base.HonoBase< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5615,6 +5630,7 @@ declare const _routes: hono_hono_base.HonoBase< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index f79c45be9..2a99b2e1b 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -1,6 +1,7 @@ import { repository } from "@pkg" import { ReadabilityStatus, + setReadabilityStatus, useEntryInReadabilityStatus, useEntryIsInReadability, useEntryReadabilityContent, @@ -266,6 +267,10 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl
+ {entry.settings?.readability && ( + + )} + {!content && (
{isPending ? ( @@ -398,6 +403,9 @@ const ReadabilityAutoToggle = ({ url, id }: { url: string; id: string }) => { useEffect(() => { if (!onceRef.current) { onceRef.current = true + setReadabilityStatus({ + [id]: ReadabilityStatus.INITIAL, + }) toggle() } }, [toggle]) diff --git a/src/renderer/src/modules/settings/action-card.tsx b/src/renderer/src/modules/settings/action-card.tsx index 684691329..857ef6a65 100644 --- a/src/renderer/src/modules/settings/action-card.tsx +++ b/src/renderer/src/modules/settings/action-card.tsx @@ -43,6 +43,7 @@ type ActionsInput = { result: { translation?: string summary?: boolean + readability?: boolean rewriteRules?: { from: string to: string @@ -446,7 +447,20 @@ export function ActionCard({
+ +
+ + {t("actions.action_card.enable_readability")} + + { + data.result.readability = checked + onChange(data) + }} + /> +
Date: Sat, 14 Sep 2024 09:17:23 +0800 Subject: [PATCH 14/66] fix: incorrect tooltip in read history (#385) --- .../entry-content/components/EntryReadHistory.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx index a08aa6c99..7de541966 100644 --- a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx +++ b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx @@ -1,6 +1,11 @@ import { useWhoami } from "@renderer/atoms/user" import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar" -import { Tooltip, TooltipContent, TooltipTrigger } from "@renderer/components/ui/tooltip" +import { + Tooltip, + TooltipContent, + TooltipPortal, + TooltipTrigger, +} from "@renderer/components/ui/tooltip" import { useAuthQuery } from "@renderer/hooks/common" import { Queries } from "@renderer/queries" import { useEntryReadHistory } from "@renderer/store/entry" @@ -63,7 +68,9 @@ export const EntryReadHistory: Component<{ entryId: string }> = ({ entryId }) =>
- More + + More + )}
@@ -101,7 +108,9 @@ const EntryUser: Component<{ - Recent reader: {user.name} + + Recent reader: {user.name} + ) }) From deb96c538258c939c60762c723d58955899031cf Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 12:25:08 +0800 Subject: [PATCH 15/66] fix: typo Signed-off-by: Innei --- locales/app/en.json | 2 +- locales/app/zh-CN.json | 2 +- src/renderer/src/components/common/ErrorElement.tsx | 4 ++-- src/renderer/src/components/errors/ModalError.tsx | 4 ++-- src/renderer/src/components/errors/PageError.tsx | 4 ++-- src/renderer/src/modules/discover/feed-form.tsx | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/locales/app/en.json b/locales/app/en.json index 64dd9a6e2..73fbffb0d 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -52,8 +52,8 @@ "feed_form.category": "Category", "feed_form.category_description": "By default, your follows will be grouped by website.", "feed_form.error_fetching_feed": "Error in fetching feed.", - "feed_form.fallback": "Fallback", "feed_form.feed_not_found": "Feed not found.", + "feed_form.feedback": "Feedback", "feed_form.follow": "Follow", "feed_form.followed": "🎉 Followed.", "feed_form.private_follow": "Private Follow", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 60bbaab6e..651bd0d68 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -49,8 +49,8 @@ "feed_form.category": "分类", "feed_form.category_description": "默认情况下,您的关注将按网站分组。", "feed_form.error_fetching_feed": "获取 Feed 时出错。", - "feed_form.fallback": "备选方案", "feed_form.feed_not_found": "未找到 Feed。", + "feed_form.feedback": "反馈", "feed_form.follow": "关注", "feed_form.followed": "🎉 已关注。", "feed_form.private_follow": "私密关注", diff --git a/src/renderer/src/components/common/ErrorElement.tsx b/src/renderer/src/components/common/ErrorElement.tsx index af8e30662..9574c99ac 100644 --- a/src/renderer/src/components/common/ErrorElement.tsx +++ b/src/renderer/src/components/common/ErrorElement.tsx @@ -77,7 +77,7 @@ export function ErrorElement() {
- +
@@ -85,7 +85,7 @@ export function ErrorElement() { ) } -export const FallbackIssue = ({ +export const FeedbackIssue = ({ message, stack, }: { diff --git a/src/renderer/src/components/errors/ModalError.tsx b/src/renderer/src/components/errors/ModalError.tsx index 73e372ff8..5cb07d7b1 100644 --- a/src/renderer/src/components/errors/ModalError.tsx +++ b/src/renderer/src/components/errors/ModalError.tsx @@ -2,7 +2,7 @@ import { attachOpenInEditor } from "@renderer/lib/dev" import type { FC } from "react" import type { AppErrorFallbackProps } from "../common/AppErrorBoundary" -import { FallbackIssue } from "../common/ErrorElement" +import { FeedbackIssue } from "../common/ErrorElement" import { m } from "../common/Motion" import { Button } from "../ui/button" import { useCurrentModal } from "../ui/modal" @@ -44,7 +44,7 @@ export const ModalErrorFallback: FC = (props) => {
- +
) diff --git a/src/renderer/src/components/errors/PageError.tsx b/src/renderer/src/components/errors/PageError.tsx index 4870cb973..7bb339809 100644 --- a/src/renderer/src/components/errors/PageError.tsx +++ b/src/renderer/src/components/errors/PageError.tsx @@ -2,7 +2,7 @@ import { attachOpenInEditor } from "@renderer/lib/dev" import type { FC } from "react" import type { AppErrorFallbackProps } from "../common/AppErrorBoundary" -import { FallbackIssue } from "../common/ErrorElement" +import { FeedbackIssue } from "../common/ErrorElement" import { Button } from "../ui/button" import { parseError, useResetErrorWhenRouteChange } from "./helper" @@ -37,7 +37,7 @@ export const PageErrorFallback: FC = (props) => {
- +
) diff --git a/src/renderer/src/modules/discover/feed-form.tsx b/src/renderer/src/modules/discover/feed-form.tsx index 8be17e6b4..4746eaae6 100644 --- a/src/renderer/src/modules/discover/feed-form.tsx +++ b/src/renderer/src/modules/discover/feed-form.tsx @@ -132,7 +132,7 @@ export const FeedForm: Component<{ ) }} > - {t("feed_form.fallback")} + {t("feed_form.feedback")}
From 8454691e221d2f8544b2b741dbaeaf95303abc51 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 12:57:20 +0800 Subject: [PATCH 16/66] feat: extract i18n text Signed-off-by: Innei --- locales/app/en.json | 35 ++++++++++++++ locales/settings/zh-CN.json | 10 ++-- .../src/hooks/biz/useEntryActions.tsx | 40 ++++++++++------ .../src/modules/claim/feed-claim-modal.tsx | 46 +++++++++---------- src/renderer/src/modules/settings/section.tsx | 2 +- .../modules/settings/tabs/wallet/index.tsx | 3 +- .../tabs/wallet/transaction-section/index.tsx | 6 +-- src/renderer/src/modules/wallet/balance.tsx | 7 ++- src/renderer/src/modules/wallet/tip-modal.tsx | 35 ++++++-------- 9 files changed, 111 insertions(+), 73 deletions(-) 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")}
From 945dddae2534f07e5289e307c36de1f8334636bc Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 13:12:44 +0800 Subject: [PATCH 17/66] feat: sync indicator when disable Signed-off-by: Innei --- locales/app/en.json | 1 + .../src/components/icons/PhCloudWarning.tsx | 18 ++ .../modules/settings/helper/SyncIndicator.tsx | 39 ++++- .../src/modules/settings/modal/hooks.ts | 21 +++ .../src/modules/settings/modal/layout.tsx | 97 +++++----- .../src/modules/settings/tabs/integration.tsx | 165 +++++++++--------- .../pages/settings/(settings)/integration.tsx | 8 +- 7 files changed, 215 insertions(+), 134 deletions(-) create mode 100644 src/renderer/src/components/icons/PhCloudWarning.tsx diff --git a/locales/app/en.json b/locales/app/en.json index 6e04a847c..3a5deadb2 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -146,6 +146,7 @@ "signin.continue_with_github": "Continue with GitHub", "signin.continue_with_google": "Continue with Google", "signin.sign_in_to": "Sign in to", + "sync_indicator.disabled": "Due to security reasons, sync is disabled.", "sync_indicator.offline": "Offline", "sync_indicator.synced": "Synced with server", "tip_modal.amount": "Amount", diff --git a/src/renderer/src/components/icons/PhCloudWarning.tsx b/src/renderer/src/components/icons/PhCloudWarning.tsx new file mode 100644 index 000000000..070953991 --- /dev/null +++ b/src/renderer/src/components/icons/PhCloudWarning.tsx @@ -0,0 +1,18 @@ +import type { SVGProps } from "react" + +export function PhCloudWarning(props: SVGProps) { + return ( + + + + ) +} diff --git a/src/renderer/src/modules/settings/helper/SyncIndicator.tsx b/src/renderer/src/modules/settings/helper/SyncIndicator.tsx index 40a369a72..8683ea728 100644 --- a/src/renderer/src/modules/settings/helper/SyncIndicator.tsx +++ b/src/renderer/src/modules/settings/helper/SyncIndicator.tsx @@ -1,16 +1,19 @@ import { PhCloudCheck } from "@renderer/components/icons/PhCloudCheck" +import { PhCloudWarning } from "@renderer/components/icons/PhCloudWarning" import { PhCloudX } from "@renderer/components/icons/PhCloudX" import { Tooltip, TooltipContent, TooltipTrigger } from "@renderer/components/ui/tooltip" import { useAuthQuery, useIsOnline } from "@renderer/hooks/common" import { settings } from "@renderer/queries/settings" -import { useEffect, useRef } from "react" +import { useEffect, useMemo, useRef } from "react" import { useTranslation } from "react-i18next" +import { useSettingContextSelector } from "../modal/hooks" import { settingSyncQueue } from "./sync-queue" -export const SyncIndicator = () => { +export const SettingSyncIndicator = () => { const { t } = useTranslation() const { data: remoteSettings, isLoading } = useAuthQuery(settings.get(), {}) + const canSync = useSettingContextSelector((s) => s.canSync) const isOnline = useIsOnline() const onceRef = useRef(false) @@ -26,17 +29,41 @@ export const SyncIndicator = () => { } }, [remoteSettings, isLoading]) + const metaInfo: { + icon: React.FC> + text: string + } = useMemo(() => { + switch (true) { + case !isOnline: { + return { + icon: PhCloudX, + text: t("sync_indicator.offline"), + } + } + case !canSync: { + return { + icon: PhCloudWarning, + text: t("sync_indicator.disabled"), + } + } + default: { + return { + icon: PhCloudCheck, + text: t("sync_indicator.synced"), + } + } + } + }, [isOnline, canSync, t]) + return (
- {isOnline ? : } +
-
- {isOnline ? t("sync_indicator.synced") : t("sync_indicator.offline")} -
+
{metaInfo.text}
) diff --git a/src/renderer/src/modules/settings/modal/hooks.ts b/src/renderer/src/modules/settings/modal/hooks.ts index 1feadfaae..acab65957 100644 --- a/src/renderer/src/modules/settings/modal/hooks.ts +++ b/src/renderer/src/modules/settings/modal/hooks.ts @@ -1,6 +1,9 @@ import { useModalStack } from "@renderer/components/ui/modal/stacked/hooks" import { NoopChildren } from "@renderer/components/ui/modal/stacked/utils" +import type { ExtractAtomValue, PrimitiveAtom } from "jotai" +import { atom, useAtomValue, useSetAtom } from "jotai" import { createElement, useCallback } from "react" +import { createContext, useContextSelector } from "use-context-selector" import { SettingModalContent } from "./content" @@ -22,3 +25,21 @@ export const useSettingModal = () => { [present], ) } + +interface Ctx { + canSync: PrimitiveAtom +} +export const defaultCtx: Ctx = { + canSync: atom(true), +} +export const SettingContext = createContext(defaultCtx) + +export const useSettingContextSelector = (selector: (state: Ctx) => T) => { + // @ts-expect-error + return useAtomValue(useContextSelector(SettingContext, selector)) as ExtractAtomValue +} + +export const useSetSettingCanSync = () => { + const canSync = useContextSelector(SettingContext, (s) => s.canSync) + return useSetAtom(canSync) +} diff --git a/src/renderer/src/modules/settings/modal/layout.tsx b/src/renderer/src/modules/settings/modal/layout.tsx index 585c35f7b..d16f1f001 100644 --- a/src/renderer/src/modules/settings/modal/layout.tsx +++ b/src/renderer/src/modules/settings/modal/layout.tsx @@ -10,9 +10,10 @@ import type { PointerEventHandler, PropsWithChildren } from "react" import { Suspense, useCallback, useEffect, useRef } from "react" import { settings } from "../constants" -import { SyncIndicator } from "../helper/SyncIndicator" +import { SettingSyncIndicator } from "../helper/SyncIndicator" import { SettingsSidebarTitle } from "../title" import { useSetSettingTab, useSettingTab } from "./context" +import { defaultCtx, SettingContext } from "./hooks" export function SettingModalLayout( props: PropsWithChildren<{ @@ -74,55 +75,57 @@ export function SettingModalLayout( cursor: "grabbing", }} > - - {draggable && ( -
- )} -
-
-
- - {APP_NAME} -
- + + + {draggable && ( +
+ )} +
+
+
+ + {APP_NAME} +
+ -
- +
+ +
+
+
+ {children}
-
- {children} -
-
- + +
) diff --git a/src/renderer/src/modules/settings/tabs/integration.tsx b/src/renderer/src/modules/settings/tabs/integration.tsx index 1b3abb208..97311107b 100644 --- a/src/renderer/src/modules/settings/tabs/integration.tsx +++ b/src/renderer/src/modules/settings/tabs/integration.tsx @@ -9,9 +9,10 @@ import { SimpleIconsInstapaper, SimpleIconsReadwise, } from "@renderer/components/ui/platform-icon/icons" +import { useEffect } from "react" import { useTranslation } from "react-i18next" -import { SettingsTitle } from "../title" +import { useSetSettingCanSync } from "../modal/hooks" const { defineSettingItem, SettingBuilder } = createSetting( useIntegrationSettingValue, @@ -19,89 +20,93 @@ const { defineSettingItem, SettingBuilder } = createSetting( ) export const SettingIntegration = () => { const { t } = useTranslation("settings") + const setSync = useSetSettingCanSync() + useEffect(() => { + setSync(false) + return () => { + setSync(true) + } + }, [setSync]) return ( - <> - -
- - - {t("integration.eagle.title")} - - ), +
+ + + {t("integration.eagle.title")} + + ), + }, + defineSettingItem("enableEagle", { + label: t("integration.eagle.enable.label"), + description: t("integration.eagle.enable.description"), + }), + { + type: "title", + value: ( + + + {t("integration.readwise.title")} + + ), + }, + defineSettingItem("enableReadwise", { + label: t("integration.readwise.enable.label"), + description: t("integration.readwise.enable.description"), + }), + defineSettingItem("readwiseToken", { + label: t("integration.readwise.token.label"), + vertical: true, + type: "password", + description: ( + <> + {t("integration.readwise.token.description")}{" "} + + readwise.io/access_token + + . + + ), + }), + { + type: "title", + value: ( + + + {t("integration.instapaper.title")} + + ), + }, + defineSettingItem("enableInstapaper", { + label: t("integration.instapaper.enable.label"), + description: t("integration.instapaper.enable.description"), + }), + defineSettingItem("instapaperUsername", { + label: t("integration.instapaper.username.label"), + componentProps: { + labelClassName: "w-[150px]", }, - defineSettingItem("enableEagle", { - label: t("integration.eagle.enable.label"), - description: t("integration.eagle.enable.description"), - }), - { - type: "title", - value: ( - - - {t("integration.readwise.title")} - - ), + }), + defineSettingItem("instapaperPassword", { + label: t("integration.instapaper.password.label"), + type: "password", + componentProps: { + labelClassName: "w-[150px]", }, - defineSettingItem("enableReadwise", { - label: t("integration.readwise.enable.label"), - description: t("integration.readwise.enable.description"), - }), - defineSettingItem("readwiseToken", { - label: t("integration.readwise.token.label"), - vertical: true, - type: "password", - description: ( - <> - {t("integration.readwise.token.description")}{" "} - - readwise.io/access_token - - . - - ), - }), - { - type: "title", - value: ( - - - {t("integration.instapaper.title")} - - ), - }, - defineSettingItem("enableInstapaper", { - label: t("integration.instapaper.enable.label"), - description: t("integration.instapaper.enable.description"), - }), - defineSettingItem("instapaperUsername", { - label: t("integration.instapaper.username.label"), - componentProps: { - labelClassName: "w-[150px]", - }, - }), - defineSettingItem("instapaperPassword", { - label: t("integration.instapaper.password.label"), - type: "password", - componentProps: { - labelClassName: "w-[150px]", - }, - }), + }), - BottomTip, - ]} - /> -
- + BottomTip, + ]} + /> +
) } diff --git a/src/renderer/src/pages/settings/(settings)/integration.tsx b/src/renderer/src/pages/settings/(settings)/integration.tsx index 58715801a..da51e866a 100644 --- a/src/renderer/src/pages/settings/(settings)/integration.tsx +++ b/src/renderer/src/pages/settings/(settings)/integration.tsx @@ -1,4 +1,5 @@ import { SettingIntegration } from "@renderer/modules/settings/tabs/integration" +import { SettingsTitle } from "@renderer/modules/settings/title" import { defineSettingPageData } from "@renderer/modules/settings/utils" const iconName = "i-mgc-department-cute-re" @@ -11,5 +12,10 @@ export const loader = defineSettingPageData({ }) export function Component() { - return + return ( + <> + + + + ) } From f7dedf2b27f2597a49e9381af5581b6d0550421b Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 13:50:25 +0800 Subject: [PATCH 18/66] feat: only show has media entry item in picture view Signed-off-by: Innei --- icons/mgc/photo_album_cute_re.svg | 1 + locales/app/en.json | 9 +++++++ locales/app/zh-CN.json | 2 +- src/renderer/src/atoms/settings/ui.ts | 1 + .../src/modules/entry-column/index.tsx | 25 ++++++++++++++++--- .../entry-column/layouts/EntryListHeader.tsx | 22 +++++++++++++++- .../src/modules/feed-column/corner-player.tsx | 12 +++++---- src/shared/src/interface/settings.ts | 1 + 8 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 icons/mgc/photo_album_cute_re.svg diff --git a/icons/mgc/photo_album_cute_re.svg b/icons/mgc/photo_album_cute_re.svg new file mode 100644 index 000000000..a385cea64 --- /dev/null +++ b/icons/mgc/photo_album_cute_re.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/locales/app/en.json b/locales/app/en.json index 3a5deadb2..0176ceae0 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -48,11 +48,13 @@ "entry_content.web_app_notice": "Maybe web app doesn't support this content type. But you can download the desktop app.", "entry_list.zero_unread": "Zero Unread", "entry_list_header.daily_report": "Daily Report", + "entry_list_header.hide_no_image_items": "Hide no images's entry items", "entry_list_header.items": "items", "entry_list_header.new_entries_available": "New entries available", "entry_list_header.refetch": "Refetch", "entry_list_header.refresh": "Refresh", "entry_list_header.show_all": "Show all", + "entry_list_header.show_all_items": "Show all entry items", "entry_list_header.show_unread_only": "Show unread Only", "entry_list_header.switch_to_grid": "Switch to Grid", "entry_list_header.switch_to_masonry": "Switch to Masonry", @@ -109,6 +111,13 @@ "mark_all_read_button.mark_all_as_read": "Mark all as read", "mark_all_read_button.mark_as_read": "Mark {{which}} as read", "mark_all_read_button.undo": "Undo", + "player.back_10s": "Back 10s", + "player.close": "Close", + "player.download": "Download", + "player.forward_10s": "Forward 10s", + "player.open_entry": "Open Entry", + "player.playback_rate": "Playback Rate", + "player.volume": "Volume", "search.empty.no_results": "No results found.", "search.group.entries": "Entries", "search.group.feeds": "Feeds", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 651bd0d68..3634579ee 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -38,7 +38,7 @@ "entry_list_header.daily_report": "每日报告", "entry_list_header.items": "内容", "entry_list_header.new_entries_available": "有新内容", - "entry_list_header.refetch": "重新获取", + "entry_list_header.refetch": "刷新", "entry_list_header.refresh": "刷新", "entry_list_header.show_all": "显示全部", "entry_list_header.show_unread_only": "仅显示未读", diff --git a/src/renderer/src/atoms/settings/ui.ts b/src/renderer/src/atoms/settings/ui.ts index 8a14b5d1e..dd4f7ac0e 100644 --- a/src/renderer/src/atoms/settings/ui.ts +++ b/src/renderer/src/atoms/settings/ui.ts @@ -30,6 +30,7 @@ export const createDefaultSettings = (): UISettings => ({ // View pictureViewMasonry: true, + pictureViewFilterNoImage: false, // TTS voice: "en-US-AndrewMultilingualNeural", diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 3e403c08d..b76e195e1 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -15,10 +15,10 @@ import { useTitle, useTypeScriptHappyCallback } from "@renderer/hooks/common" import { FeedViewType } from "@renderer/lib/enum" import { cn, isBizId } from "@renderer/lib/utils" import { useFeed } from "@renderer/queries/feed" -import { entryActions, useEntry } from "@renderer/store/entry" +import { entryActions, getEntry, useEntry } from "@renderer/store/entry" import { useFeedByIdSelector } from "@renderer/store/feed" import { useSubscriptionByFeedId } from "@renderer/store/subscription" -import { memo, useCallback, useEffect, useRef, useState } from "react" +import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react" import { useTranslation } from "react-i18next" import type { ScrollSeekConfiguration, @@ -238,17 +238,34 @@ const ListGird = ({ const masonry = useUISettingKey("pictureViewMasonry") const view = useRouteParamsSelector((s) => s.view) const feedId = useRouteParamsSelector((s) => s.feedId) + const filterNoImage = useUISettingKey("pictureViewFilterNoImage") + const nextData = useMemo(() => { + if (filterNoImage) { + return virtuosoOptions.data.filter((entryId) => { + const entry = getEntry(entryId) + return entry?.entries.media?.length && entry.entries.media.length > 0 + }) + } + return virtuosoOptions.data + }, [virtuosoOptions.data, filterNoImage]) if (masonry && view === FeedViewType.Pictures) { return ( virtuosoOptions.data.length} endReached={virtuosoOptions.endReached} - data={virtuosoOptions.data} + data={nextData} /> ) } - return + return ( + + ) } const AddFeedHelper = () => { diff --git a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx index d486e657b..94ba8a12d 100644 --- a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx +++ b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx @@ -96,6 +96,7 @@ export const EntryListHeader: FC<{ {view === FeedViewType.SocialMedia && } {view === FeedViewType.Pictures && } + {view === FeedViewType.Pictures && } {isOnline ? ( @@ -173,6 +174,25 @@ const DailyReportButton: FC = () => { ) } +const FilterNoImageButton = () => { + const enabled = useUISettingKey("pictureViewFilterNoImage") + const { t } = useTranslation() + + return ( + { + setUISetting("pictureViewFilterNoImage", !enabled) + }} + tooltip={t( + enabled ? "entry_list_header.show_all_items" : "entry_list_header.hide_no_image_items", + )} + > + + + ) +} + const SwitchToMasonryButton = () => { const isMasonry = useUISettingKey("pictureViewMasonry") const { t } = useTranslation() @@ -193,7 +213,7 @@ const SwitchToMasonryButton = () => { }) }} tooltip={ - isMasonry + !isMasonry ? t("entry_list_header.switch_to_masonry") : t("entry_list_header.switch_to_grid") } diff --git a/src/renderer/src/modules/feed-column/corner-player.tsx b/src/renderer/src/modules/feed-column/corner-player.tsx index 11631e17f..e547457d6 100644 --- a/src/renderer/src/modules/feed-column/corner-player.tsx +++ b/src/renderer/src/modules/feed-column/corner-player.tsx @@ -21,6 +21,7 @@ import { AnimatePresence, m } from "framer-motion" import { useEffect, useState } from "react" import Marquee from "react-fast-marquee" import { useHotkeys } from "react-hotkeys-hook" +import { useTranslation } from "react-i18next" const handleClickPlay = () => { AudioPlayer.togglePlayAndPause() @@ -85,6 +86,7 @@ const usePlayerTracker = () => { }, [show]) } const CornerPlayerImpl = () => { + const { t } = useTranslation() const entryId = useAudioPlayerAtomSelector((v) => v.entryId) const status = useAudioPlayerAtomSelector((v) => v.status) const isMute = useAudioPlayerAtomSelector((v) => v.isMute) @@ -156,7 +158,7 @@ const CornerPlayerImpl = () => { AudioPlayer.close()} - label="Close" + label={t("player.close")} /> { view: FeedViewType.Audios, }) } - label="Open Entry" + label={t("player.open_entry")} />
{ window.open(AudioPlayer.get().src, "_blank") }} @@ -193,12 +195,12 @@ const CornerPlayerImpl = () => { AudioPlayer.back(10)} - label="Back 10s" + label={t("player.back_10s")} /> AudioPlayer.forward(10)} - label="Forward 10s" + label={t("player.forward_10s")} tooltipAlign="end" />
diff --git a/src/shared/src/interface/settings.ts b/src/shared/src/interface/settings.ts index fff15fb4d..567a12ddf 100644 --- a/src/shared/src/interface/settings.ts +++ b/src/shared/src/interface/settings.ts @@ -30,6 +30,7 @@ export interface UISettings { // view pictureViewMasonry: boolean + pictureViewFilterNoImage: boolean // tts voice: string From a4982289f8b4a7967e9ebea837109bd5e342b663 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 13:57:30 +0800 Subject: [PATCH 19/66] feat: video player i18n Signed-off-by: Innei --- locales/app/en.json | 6 ++++++ .../src/components/ui/media/VideoPlayer.tsx | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/locales/app/en.json b/locales/app/en.json index 0176ceae0..668d47a54 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -114,9 +114,15 @@ "player.back_10s": "Back 10s", "player.close": "Close", "player.download": "Download", + "player.exit_full_screen": "Exit Full Screen", "player.forward_10s": "Forward 10s", + "player.full_screen": "Full Screen", + "player.mute": "Mute", "player.open_entry": "Open Entry", + "player.pause": "Pause", + "player.play": "Play", "player.playback_rate": "Playback Rate", + "player.unmute": "Unmute", "player.volume": "Volume", "search.empty.no_results": "No results found.", "search.group.entries": "Entries", diff --git a/src/renderer/src/components/ui/media/VideoPlayer.tsx b/src/renderer/src/components/ui/media/VideoPlayer.tsx index bbabc9996..4d80fd5fc 100644 --- a/src/renderer/src/components/ui/media/VideoPlayer.tsx +++ b/src/renderer/src/components/ui/media/VideoPlayer.tsx @@ -20,6 +20,7 @@ import { useState, } from "react" import { useHotkeys } from "react-hotkeys-hook" +import { useTranslation } from "react-i18next" import { createContext, useContext, useContextSelector } from "use-context-selector" import { useEventCallback } from "usehooks-ts" @@ -208,6 +209,7 @@ const FloatMutedButton = () => { } const ControlBar = memo(() => { + const { t } = useTranslation() const controls = useContextSelector(VideoPlayerContext, (v) => v.controls) const isPaused = useContextSelector(VideoPlayerContext, (v) => v.state.paused) const dragControls = useDragControls() @@ -235,7 +237,7 @@ const ControlBar = memo(() => { { if (isPaused) { @@ -268,6 +270,7 @@ const ControlBar = memo(() => { }) const FullScreenControl = () => { + const { t } = useTranslation() const ref = useContextSelector(VideoPlayerContext, (v) => v.wrapperRef) const [isFullScreen, setIsFullScreen] = useState(!!document.fullscreenElement) @@ -283,7 +286,7 @@ const FullScreenControl = () => { return ( { @@ -306,6 +309,7 @@ const FullScreenControl = () => { } const DownloadVideo = () => { + const { t } = useTranslation() const src = useContextSelector(VideoPlayerContext, (v) => v.src) const [isDownloading, setIsDownloading] = useState(false) const download = useEventCallback(() => { @@ -324,7 +328,7 @@ const DownloadVideo = () => { }) return ( - + {isDownloading ? ( ) : ( @@ -334,6 +338,7 @@ const DownloadVideo = () => { ) } const VolumeControl = () => { + const { t } = useTranslation() const hasAudio = useContextSelector(VideoPlayerContext, (v) => v.state.hasAudio) const controls = useContextSelector(VideoPlayerContext, (v) => v.controls) @@ -352,7 +357,11 @@ const VolumeControl = () => { }} labelDelayDuration={1} > - {muted ? : } + {muted ? ( + + ) : ( + + )} ) } @@ -446,7 +455,7 @@ const ActionIcon = ({ {children || } - + {label} {shortcut && {shortcut}} From 53f3185e7955d1a72912905d8565c5efb0a0bda0 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 14:10:18 +0800 Subject: [PATCH 20/66] fix: add bg when context menu trigger, fix #389 Signed-off-by: Innei --- src/renderer/src/modules/feed-column/category.tsx | 11 ++++++++--- src/renderer/src/modules/feed-column/item.tsx | 11 +++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/modules/feed-column/category.tsx b/src/renderer/src/modules/feed-column/category.tsx index d8d24154f..c20a196eb 100644 --- a/src/renderer/src/modules/feed-column/category.tsx +++ b/src/renderer/src/modules/feed-column/category.tsx @@ -15,8 +15,8 @@ import { useMutation } from "@tanstack/react-query" import { AnimatePresence, m } from "framer-motion" import type { FC } from "react" import { Fragment, memo, useEffect, useRef, useState } from "react" -import {useTranslation } from "react-i18next" -import { useOnClickOutside } from "usehooks-ts" +import { useTranslation } from "react-i18next" +import { useClickAnyWhere, useOnClickOutside } from "usehooks-ts" import { useModalStack } from "../../components/ui/modal/stacked/hooks" import { useFeedListSortSelector } from "./atom" @@ -108,6 +108,10 @@ function FeedCategoryImpl({ const [isCategoryEditing, setIsCategoryEditing] = useState(false) + const [isContextMenuOpen, setIsContextMenuOpen] = useState(false) + useClickAnyWhere(() => { + setIsContextMenuOpen(false) + }) const isCategoryIsWaiting = isChangePending return ( @@ -116,7 +120,7 @@ function FeedCategoryImpl({
{ e.stopPropagation() @@ -125,6 +129,7 @@ function FeedCategoryImpl({ } }} onContextMenu={(e) => { + setIsContextMenuOpen(true) showNativeMenu( [ { diff --git a/src/renderer/src/modules/feed-column/item.tsx b/src/renderer/src/modules/feed-column/item.tsx index fa5f1ab01..9604f740c 100644 --- a/src/renderer/src/modules/feed-column/item.tsx +++ b/src/renderer/src/modules/feed-column/item.tsx @@ -20,8 +20,9 @@ import { useSubscriptionByFeedId } from "@renderer/store/subscription" import { useFeedUnreadStore } from "@renderer/store/unread" import { WEB_URL } from "@shared/constants" import dayjs from "dayjs" -import { memo, useCallback } from "react" +import { memo, useCallback, useState } from "react" import { useTranslation } from "react-i18next" +import { useClickAnyWhere } from "usehooks-ts" import { UnreadNumber } from "./unread-number" @@ -60,6 +61,10 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI const { items } = useFeedActions({ feedId, view }) + const [isContextMenuOpen, setIsContextMenuOpen] = useState(false) + useClickAnyWhere(() => { + setIsContextMenuOpen(false) + }) if (!feed) return null return ( @@ -68,7 +73,8 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI data-feed-id={feedId} className={cn( "flex w-full items-center justify-between rounded-md py-[2px] pr-2.5 text-sm font-medium leading-loose", - isActive && "bg-native-active", + (isActive || isContextMenuOpen) && "bg-native-active", + className, )} onClick={handleNavigate} @@ -76,6 +82,7 @@ const FeedItemImpl = ({ view, feedId, className, showUnreadCount = true }: FeedI window.open(`${WEB_URL}/feed/${feedId}?view=${view}`, "_blank") }} onContextMenu={(e) => { + setIsContextMenuOpen(true) const nextItems = items.concat() if (feed.errorAt && feed.errorMessage) { nextItems.push( From 8d8aa09230eb5ddd55dffe074b20c9ed81e84a99 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 14:25:58 +0800 Subject: [PATCH 21/66] feat: external page i18n Signed-off-by: Innei --- locales/external/en.json | 34 +++++++++++++++++++ src/renderer/src/components/header.tsx | 6 ++-- .../(with-layout)/feed/[id]/index.tsx | 15 +++++--- .../src/pages/(external)/invitation.tsx | 13 +++---- src/renderer/src/pages/(external)/login.tsx | 17 ++++++---- 5 files changed, 62 insertions(+), 23 deletions(-) diff --git a/locales/external/en.json b/locales/external/en.json index 64b46f351..7aca60ec8 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -1,4 +1,38 @@ { + "feed": { + "follow_one": "follow", + "follow_other": "follows", + "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} with {{readCount}} {{readNoun}} on {{appName}}", + "read_one": "read", + "read_other": "reads" + }, + "header": { + "app": "App", + "download": "Download" + }, + "invitation": { + "activate": "Activate", + "codeOptions": { + "1": "Looking for any alpha test user to invite you.", + "2": "Join our Discord server for occasional giveaways.", + "3": "Follow our X account for occasional giveaways." + }, + "earlyAccess": "Follow is currently in early access and requires an invitation code to use.", + "earlyAccessMessage": "😰 Sorry, Follow is currently in early access and requires an invitation code to use.", + "generateButton": "Generate new code", + "generateCost": "You can spend {{INVITATION_PRICE}} Power to generate an invitation code for your friends.", + "getCodeMessage": "You can get an invitation code in the following ways:", + "title": "Invitation Code" + }, + "login": { + "backToWebApp": "Back To Web App", + "continueWithGitHub": "Continue with GitHub", + "continueWithGoogle": "Continue with Google", + "logInTo": "Log in to ", + "openApp": "Open App", + "redirecting": "Redirecting", + "welcomeTo": "Welcome to " + }, "redirect": { "continueInBrowser": "Continue in Browser", "instruction": "Now is the time to open {{APP_NAME}} and safely close this page.", diff --git a/src/renderer/src/components/header.tsx b/src/renderer/src/components/header.tsx index 785f2f07d..2cf4f55f9 100644 --- a/src/renderer/src/components/header.tsx +++ b/src/renderer/src/components/header.tsx @@ -5,6 +5,7 @@ import type { MotionValue } from "framer-motion" import { useMotionValueEvent, useScroll } from "framer-motion" import type { FC } from "react" import { cloneElement, useState } from "react" +import { useTranslation } from "react-i18next" import { Link } from "react-router-dom" import { FollowIcon } from "./icons/follow" @@ -19,6 +20,7 @@ const useMotionValueToState = (value: MotionValue) => { export function Header() { const present = usePresentUserProfileModal() + const { t } = useTranslation("external") const { scrollY } = useScroll() const scrollYState = useMotionValueToState(scrollY) @@ -40,12 +42,12 @@ export function Header() {
- } label="App" /> + } label={t("header.app")} /> } - label="Download" + label={t("header.download")} />
diff --git a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx index 803d529c5..9bfaa56ea 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx @@ -6,7 +6,7 @@ import { LoadingCircle } from "@renderer/components/ui/loading" import { views } from "@renderer/constants" import { useTitle } from "@renderer/hooks/common" import { FeedViewType } from "@renderer/lib/enum" -import { cn, pluralize } from "@renderer/lib/utils" +import { cn } from "@renderer/lib/utils" import { ArticleItem } from "@renderer/modules/entry-column/Items/article-item" import { NotificationItem } from "@renderer/modules/entry-column/Items/notification-item" import { PictureItem } from "@renderer/modules/entry-column/Items/picture-item" @@ -17,6 +17,7 @@ import { useEntriesPreview } from "@renderer/queries/entries" import { useFeed } from "@renderer/queries/feed" import { DEEPLINK_SCHEME } from "@shared/constants" import type { FC } from "react" +import { useTranslation } from "react-i18next" import { useParams, useSearchParams } from "react-router-dom" export function Component() { @@ -57,6 +58,7 @@ export function Component() { Item = ArticleItem } } + const { t } = useTranslation("external") useTitle(feed.data?.feed.title) return ( <> @@ -78,10 +80,13 @@ export function Component() {
{feed.data.feed.description}
- {feed.data.subscriptionCount}{" "} - {pluralize("follow", feed.data.subscriptionCount)} with{" "} - {feed.data.readCount} {pluralize("read", feed.data.readCount)} on{" "} - {APP_NAME} + {t("feed.followsAndReads", { + subscriptionCount: feed.data.subscriptionCount, + subscriptionNoun: t("feed.follow", { count: feed.data.subscriptionCount }), + readCount: feed.data.readCount, + readNoun: t("feed.read", { count: feed.data.readCount }), + appName: APP_NAME, + })}
@@ -92,7 +95,7 @@ function Login() { loginHandler("github") }} > - Continue with GitHub + {t("login.continueWithGitHub")} )} From d20ef05794dd6872cf553c11948172655275818a Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 15:28:56 +0800 Subject: [PATCH 22/66] feat: i18n generator Signed-off-by: Innei --- package.json | 1 + pnpm-lock.yaml | 27 ++ scripts/generate-i18n-locale.ts | 405 +++++++++++++++++++++++++++ src/renderer/src/@types/constants.ts | 3 +- 4 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 scripts/generate-i18n-locale.ts diff --git a/package.json b/package.json index fce3c0cf4..1200168d1 100644 --- a/package.json +++ b/package.json @@ -147,6 +147,7 @@ }, "devDependencies": { "@babel/generator": "7.25.6", + "@clack/prompts": "0.7.0", "@egoist/tailwindcss-icons": "1.8.1", "@electron-forge/cli": "7.4.0", "@electron-forge/maker-dmg": "7.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7c3c9e949..e8fe25a68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -360,6 +360,9 @@ importers: '@babel/generator': specifier: 7.25.6 version: 7.25.6 + '@clack/prompts': + specifier: 0.7.0 + version: 0.7.0 '@egoist/tailwindcss-icons': specifier: 1.8.1 version: 1.8.1(tailwindcss@3.4.11) @@ -1157,6 +1160,14 @@ packages: '@cfcs/core@0.0.5': resolution: {integrity: sha512-TZ/RXKV7MUrqFpiX+16uaaptv5jgChWNsuE6w8Rn3eJbO1PFd4Wpn25zeJbii7ch46ck8/ZIIYCcW3pHiYtm4Q==} + '@clack/core@0.3.4': + resolution: {integrity: sha512-H4hxZDXgHtWTwV3RAVenqcC4VbJZNegbBjlPvzOzCouXtS2y3sDvlO3IsbrPNWuLWPPlYVYPghQdSF64683Ldw==} + + '@clack/prompts@0.7.0': + resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} + bundledDependencies: + - is-unicode-supported + '@conventional-changelog/git-client@1.0.1': resolution: {integrity: sha512-PJEqBwAleffCMETaVm/fUgHldzBE35JFk3/9LL6NUA5EXa3qednu+UT6M7E5iBu3zIQZCULYIiZ90fBYHt6xUw==} engines: {node: '>=18'} @@ -7472,6 +7483,9 @@ packages: resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} hasBin: true + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -9159,6 +9173,17 @@ snapshots: dependencies: '@egjs/component': 3.0.5 + '@clack/core@0.3.4': + dependencies: + picocolors: 1.1.0 + sisteransi: 1.0.5 + + '@clack/prompts@0.7.0': + dependencies: + '@clack/core': 0.3.4 + picocolors: 1.1.0 + sisteransi: 1.0.5 + '@conventional-changelog/git-client@1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)': dependencies: '@types/semver': 7.5.8 @@ -16876,6 +16901,8 @@ snapshots: simple-git-hooks@2.11.1: {} + sisteransi@1.0.5: {} + slash@3.0.0: {} slice-ansi@3.0.0: diff --git a/scripts/generate-i18n-locale.ts b/scripts/generate-i18n-locale.ts new file mode 100644 index 000000000..12045bd21 --- /dev/null +++ b/scripts/generate-i18n-locale.ts @@ -0,0 +1,405 @@ +import { execSync } from "node:child_process" +import { readdirSync, readFileSync, writeFileSync } from "node:fs" +import path, { dirname } from "node:path" +import { fileURLToPath } from "node:url" + +import { intro, outro, select } from "@clack/prompts" +import color from "picocolors" +import * as ts from "typescript" + +const locales = [ + "af", + "am", + "ar-dz", + "ar-iq", + "ar-kw", + "ar-ly", + "ar-ma", + "ar-sa", + "ar-tn", + + "az", + "be", + "bg", + "bi", + "bm", + "bn-bd", + "bn", + "bo", + "br", + + "bs", + "ca", + "cs", + "cv", + "cy", + "da-at", + "da-ch", + "da", + "dv", + + "el", + "en-au", + "en-ca", + "en-gb", + "en-ie", + "en-il", + "en-in", + "en-nz", + "en-sg", + "en-tt", + + "eo", + "es-do", + "es-mx", + "es-pr", + "es-us", + "es", + "et", + "eu", + + "fa", + "fi", + "fo", + "fr-ca", + "fr-ch", + "fr", + "fy", + "ga", + + "gd", + "gl", + "gom-latn", + "gu", + "he", + "hi", + "hr", + "ht", + + "hu", + "hy-am", + "id", + "is", + "it-ch", + "it", + "ja", + "jv", + + "ka", + "kk", + "km", + "kn", + "ko", + "ku", + "ky", + "lb", + + "lo", + "lt", + "lv", + "me", + "mi", + "mk", + "ml", + "mn", + + "mr", + "ms-my", + "ms", + "mt", + "my", + "nb", + "ne", + "nl-be", + "nl", + + "oc-lnc", + "pa-in", + "pl", + "pt-br", + "pt", + "rn", + "ro", + "ru", + "sd", + "se", + "si", + "sk", + "sl", + "sq", + "sr-cyrl", + "sr", + "ss", + + "sv-fi", + "sv", + "sw", + "ta", + "te", + "tet", + "tg", + "th", + "tk", + "tl-ph", + "tlh", + "tr", + "tzl", + "tzm-latn", + "tzm", + "ug-cn", + "uk", + + "ur", + "uz-latn", + "uz", + "vi", + "x-pseudo", + "yo", + "zh-cn", + "zh-hk", + "zh-tw", + "zh", +] + +async function selectLocale(): Promise { + intro(color.blue("Locale Selection")) + + const selectedLocale = await select({ + message: "Select a locale:", + options: locales.map((locale) => ({ value: locale, label: locale })), + maxItems: 10, + }) + + if (typeof selectedLocale !== "string") { + throw new TypeError("No locale selected") + } + + return selectedLocale +} + +const __dirname = dirname(fileURLToPath(import.meta.url)) +const LOCALE_DIR = path.resolve(__dirname, "../locales") +const CONFIG_DIR = path.resolve(__dirname, "../src/renderer/src/@types") + +async function main() { + const selectedLocale = await selectLocale() + outro(`You selected: ${color.green(selectedLocale)}`) + + const readdirLocales = readdirSync(LOCALE_DIR) + for (const ns of readdirLocales) { + const isExistResource = readdirSync(path.resolve(LOCALE_DIR, ns)).includes( + `${selectedLocale}.json`, + ) + if (!isExistResource) { + // Create new resource file, write a empty json + writeFileSync(path.resolve(LOCALE_DIR, ns, `${selectedLocale}.json`), "{}") + } + } + + // Update config file + const defaultResourceFilePath = path.resolve(CONFIG_DIR, "default-resource.ts") + const defaultResourceFileContent = readFileSync(defaultResourceFilePath, "utf8") + + const sourceFile = ts.createSourceFile( + defaultResourceFilePath, + defaultResourceFileContent, + ts.ScriptTarget.Latest, + true, + ) + + const updatedContent = updateDefaultResourceFile(sourceFile, selectedLocale) + if (updatedContent !== defaultResourceFileContent) { + writeFileSync(defaultResourceFilePath, updatedContent) + console.info(`Updated ${defaultResourceFilePath} with new locale: ${selectedLocale}`) + } else { + console.info(`Locale ${selectedLocale} already exists in default-resource.ts`) + } + + // Update constants file + const constantsFilePath = path.resolve(CONFIG_DIR, "constants.ts") + const constantsFileContent = readFileSync(constantsFilePath, "utf8") + + const constantsSourceFile = ts.createSourceFile( + constantsFilePath, + constantsFileContent, + ts.ScriptTarget.Latest, + true, + ) + + const updatedConstantsContent = updateConstantsFile(constantsSourceFile, selectedLocale) + if (updatedConstantsContent !== constantsFileContent) { + writeFileSync(constantsFilePath, updatedConstantsContent) + console.info(`Updated ${constantsFilePath} with new locale: ${selectedLocale}`) + } else { + console.info(`Locale ${selectedLocale} already exists in constants.ts`) + } + + // format these files + execSync(`npx prettier --write ${defaultResourceFilePath} ${constantsFilePath}`) + + console.info("Done!") + console.info("Please open your editor and fill in the missing translations.") + console.info(`Resources: ${color.green("locales/")}${color.green(selectedLocale)}`) +} + +function updateDefaultResourceFile(sourceFile: ts.SourceFile, locale: string): string { + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }) + const result = ts.transform(sourceFile, [ + (context) => (rootNode) => { + let importsAdded = false + + function visit(node: ts.Node): ts.Node { + if (ts.isImportDeclaration(node) && !importsAdded) { + const newImports = [ + createImportDeclaration( + `lang_${locale.replace("-", "")}`, + `../../../../locales/lang/${locale}.json`, + ), + createImportDeclaration( + `common_${locale.replace("-", "")}`, + `../../../../locales/common/${locale}.json`, + ), + ] + importsAdded = true + return [node, ...newImports] as unknown as ts.Node + } + + if ( + ts.isVariableDeclaration(node) && + ts.isIdentifier(node.name) && + node.name.text === "defaultResources" && + node.initializer && + ts.isObjectLiteralExpression(node.initializer) + ) { + const existingLocale = node.initializer.properties.find( + (prop) => ts.isPropertyAssignment(prop) && prop.name.getText() === `"${locale}"`, + ) + + if (existingLocale) { + return node + } + + const newProperties = [ + ...node.initializer.properties, + ts.factory.createPropertyAssignment( + ts.factory.createStringLiteral(locale), + ts.factory.createObjectLiteralExpression([ + ts.factory.createPropertyAssignment( + "lang", + ts.factory.createIdentifier(`lang_${locale.replace("-", "")}`), + ), + ts.factory.createPropertyAssignment( + "common", + ts.factory.createIdentifier(`common_${locale.replace("-", "")}`), + ), + ]), + ), + ] + + return ts.factory.updateVariableDeclaration( + node, + node.name, + node.exclamationToken, + node.type, + ts.factory.createObjectLiteralExpression(newProperties, true), + ) + } + return ts.visitEachChild(node, visit, context) + } + + return ts.visitNode(rootNode, visit) as ts.SourceFile + }, + ]) + + return printer.printFile(result.transformed[0] as ts.SourceFile) +} + +function createImportDeclaration(identifier: string, path: string): ts.ImportDeclaration { + return ts.factory.createImportDeclaration( + undefined, + ts.factory.createImportClause(false, ts.factory.createIdentifier(identifier), void 0), + ts.factory.createStringLiteral(path), + ) +} + +function updateConstantsFile(sourceFile: ts.SourceFile, locale: string): string { + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }) + const result = ts.transform(sourceFile, [ + (context) => (rootNode) => { + function visit(node: ts.Node): ts.Node { + if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) { + if (node.name.text === "langs") { + return updateLangsArray(node, locale) + } + if (node.name.text === "dayjsLocaleImportMap") { + return updateDayjsLocaleImportMap(node, locale) + } + } + return ts.visitEachChild(node, visit, context) + } + return ts.visitNode(rootNode, visit) as ts.SourceFile + }, + ]) + + return printer.printFile(result.transformed[0] as ts.SourceFile) +} + +function updateLangsArray(node: ts.VariableDeclaration, locale: string): ts.VariableDeclaration { + if (node.initializer && ts.isArrayLiteralExpression(node.initializer)) { + const existingElements = node.initializer.elements + if (!existingElements.some((el) => ts.isStringLiteral(el) && el.text === locale)) { + const newElements = [...existingElements, ts.factory.createStringLiteral(locale)] + const newInitializer = ts.factory.createArrayLiteralExpression(newElements, true) + return ts.factory.updateVariableDeclaration( + node, + node.name, + node.exclamationToken, + node.type, + newInitializer, + ) + } + } + return node +} + +function updateDayjsLocaleImportMap( + node: ts.VariableDeclaration, + locale: string, +): ts.VariableDeclaration { + if (node.initializer && ts.isObjectLiteralExpression(node.initializer)) { + const existingProperties = node.initializer.properties + if ( + !existingProperties.some( + (prop) => ts.isPropertyAssignment(prop) && prop.name.getText() === `["${locale}"]`, + ) + ) { + const newProperty = ts.factory.createPropertyAssignment( + ts.factory.createComputedPropertyName(ts.factory.createStringLiteral(locale)), + ts.factory.createArrayLiteralExpression([ + ts.factory.createStringLiteral(locale.toLowerCase()), + ts.factory.createArrowFunction( + undefined, + undefined, + [], + undefined, + ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), + ts.factory.createCallExpression(ts.factory.createIdentifier("import"), undefined, [ + ts.factory.createStringLiteral(`dayjs/locale/${locale.toLowerCase()}`), + ]), + ), + ]), + ) + const newProperties = [...existingProperties, newProperty] + return ts.factory.updateVariableDeclaration( + node, + node.name, + node.exclamationToken, + node.type, + ts.factory.createObjectLiteralExpression(newProperties, true), + ) + } + } + return node +} + +main().catch(console.error) diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index ed9ee19c8..cb4c6e193 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -1,4 +1,5 @@ -export const currentSupportedLanguages = ["en", "ja", "zh-CN"].sort() +const langs = ["en", "ja", "zh-CN"] +export const currentSupportedLanguages = langs.sort() export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], From ebfb4d50e95b480a24b3d242be4f1cb3a6c5ffcc Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 15:35:46 +0800 Subject: [PATCH 23/66] chore: add wiki Signed-off-by: Innei --- .github/ISSUE_TEMPLATE/i18n.yml | 54 +++++++++++++++++++++++++++++++++ package.json | 2 ++ pnpm-lock.yaml | 11 ++++--- wiki/contribute-i18n.md | 54 +++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/i18n.yml create mode 100644 wiki/contribute-i18n.md diff --git a/.github/ISSUE_TEMPLATE/i18n.yml b/.github/ISSUE_TEMPLATE/i18n.yml new file mode 100644 index 000000000..c2e5541b0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/i18n.yml @@ -0,0 +1,54 @@ +name: 🌐 Internationalization (i18n) +description: Contribute to or report issues with translations +title: "[i18n]: " +labels: ["i18n", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to contribute to our internationalization efforts! + + Before proceeding, please check our [i18n Contribution Guidelines](https://github.com/RSSNext/Follow/blob/dev/wiki/contribute-i18n.md) for detailed instructions. + - type: dropdown + id: type + attributes: + label: Type of i18n contribution + options: + - New language support + - Update existing translations + - Report incorrect translation + - Other i18n-related issue + validations: + required: true + - type: input + id: language + attributes: + label: Language + description: What language are you contributing to or reporting about? + placeholder: e.g., Spanish, French, Japanese + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: Please provide details about your contribution or the issue you're reporting. + placeholder: | + For new languages: List any specific challenges or considerations. + For updates: Describe what you're changing and why. + For issues: Provide the incorrect translation and suggest a correction. + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context, screenshots, or file references here. + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com/code-of-conduct) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/package.json b/package.json index 1200168d1..1348c65bf 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dev:debug": "export DEBUG=true && vite --debug", "dev:web": "vite", "format": "prettier --write .", + "generator:i18n-template": "tsx scripts/generate-i18n-locale.ts", "lint": "eslint", "lint:fix": "eslint --fix", "polyfill-optimize": "pnpx nolyfill install", @@ -192,6 +193,7 @@ "simple-git-hooks": "2.11.1", "tailwindcss": "3.4.11", "tailwindcss-animate": "1.0.7", + "tsx": "4.19.1", "typescript": "^5.6.2", "vite": "^5.4.4", "vite-bundle-analyzer": "0.10.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8fe25a68..82021cb2e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -495,6 +495,9 @@ importers: tailwindcss-animate: specifier: 1.0.7 version: 1.0.7(tailwindcss@3.4.11) + tsx: + specifier: 4.19.1 + version: 4.19.1 typescript: specifier: ^5.6.2 version: 5.6.2 @@ -7857,8 +7860,8 @@ packages: tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - tsx@4.19.0: - resolution: {integrity: sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==} + tsx@4.19.1: + resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} engines: {node: '>=18.0.0'} hasBin: true @@ -14620,7 +14623,7 @@ snapshots: jiti: 2.0.0-beta.3 jiti-v1: jiti@1.21.6 pathe: 1.1.2 - tsx: 4.19.0 + tsx: 4.19.1 transitivePeerDependencies: - supports-color @@ -17290,7 +17293,7 @@ snapshots: tslib@2.7.0: {} - tsx@4.19.0: + tsx@4.19.1: dependencies: esbuild: 0.23.1 get-tsconfig: 4.8.0 diff --git a/wiki/contribute-i18n.md b/wiki/contribute-i18n.md new file mode 100644 index 000000000..ef163f2a9 --- /dev/null +++ b/wiki/contribute-i18n.md @@ -0,0 +1,54 @@ +# Contributing to Internationalization (i18n) + +We welcome contributions to our internationalization efforts! This guide will help you get started with adding or updating translations for our project. + +## Adding a New Language + +To add support for a new language: + +1. Run the following command in the project root: + + ```bash + npm run generator:i18n-template + ``` + +2. Select the desired locale from the list. + +3. The script will: + - Create new resource files for the selected locale + - Update the necessary configuration files + +4. Open your editor and navigate to the `locales/` directory. You'll find new JSON files for the selected locale. + +5. Translate the keys in these JSON files to the target language. + +## Updating Existing Translations + +To update or improve existing translations: + +1. Navigate to the `locales/` directory. +2. Find the JSON files for the language you want to update. +3. Edit the translations as needed. + +## Translation Guidelines + +- Maintain the same structure and keys as the original English version. +- Ensure translations are culturally appropriate and context-aware. +- Use gender-neutral language where possible. +- Keep special placeholders (e.g., `{{variable}}`) intact. + +## Testing Your Translations + +After making changes: + +1. Run the application locally. +2. Switch to the language you've edited. +3. Navigate through the app to verify your translations in context. + +## Submitting Your Contribution + +1. Create a new branch for your changes. +2. Commit your changes with a clear, descriptive message. +3. Open a pull request with details about the languages and sections you've updated. + +Thank you for helping make our project more accessible to users worldwide! From 371529340384652d0593fbf193be6702e8e10ac4 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 15:43:36 +0800 Subject: [PATCH 24/66] chore(wiki): add before start Signed-off-by: Innei --- wiki/contribute-i18n.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wiki/contribute-i18n.md b/wiki/contribute-i18n.md index ef163f2a9..1ef07c4a9 100644 --- a/wiki/contribute-i18n.md +++ b/wiki/contribute-i18n.md @@ -2,6 +2,10 @@ We welcome contributions to our internationalization efforts! This guide will help you get started with adding or updating translations for our project. +## Pay Attention + +If it's a new language, please check for [existing issues](https://github.com/RSSNext/Follow/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+label%3Ai18n) before starting. If none exist, submit a new issue to avoid duplicating efforts. + ## Adding a New Language To add support for a new language: From d5ce4744fe28c5d4d05844af6fe344fdf7849424 Mon Sep 17 00:00:00 2001 From: karasu Date: Sat, 14 Sep 2024 17:02:21 +0800 Subject: [PATCH 25/66] feat: prompt the full categories when editing the feed (#392) --- src/renderer/src/modules/discover/feed-form.tsx | 2 +- src/renderer/src/queries/subscriptions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/modules/discover/feed-form.tsx b/src/renderer/src/modules/discover/feed-form.tsx index 4746eaae6..47d0718f0 100644 --- a/src/renderer/src/modules/discover/feed-form.tsx +++ b/src/renderer/src/modules/discover/feed-form.tsx @@ -248,7 +248,7 @@ const FeedInnerForm = ({ const { t } = useTranslation() - const categories = useAuthQuery(subscriptionQuery.categories(Number.parseInt(form.watch("view")))) + const categories = useAuthQuery(subscriptionQuery.categories()) // useEffect(() => { // if (feed.isSuccess) nextFrame(() => buttonRef.current?.focus()); diff --git a/src/renderer/src/queries/subscriptions.ts b/src/renderer/src/queries/subscriptions.ts index 6218d6d9d..81d708b1f 100644 --- a/src/renderer/src/queries/subscriptions.ts +++ b/src/renderer/src/queries/subscriptions.ts @@ -12,7 +12,7 @@ export const subscription = { categories: (view?: number) => defineQuery(["subscription-categories", view], async () => { const res = await apiClient.categories.$get({ - query: { view: String(view) }, + query: { view: view ? String(view) : undefined }, }) return res.data From e7f923a0a08e5a4c7e13ff8dd76820f1b4265f25 Mon Sep 17 00:00:00 2001 From: Stephen Zhou Date: Sat, 14 Sep 2024 17:19:21 +0800 Subject: [PATCH 26/66] feat: expand entry read history (#377) * feat: expand entry read history * chore: update * refactor: use drop down * feat: re-design style Signed-off-by: Innei * fix: text overflow Signed-off-by: Innei --------- Signed-off-by: Innei Co-authored-by: Innei --- .../src/components/ui/modal/stacked/modal.tsx | 2 + src/renderer/src/lib/dev.tsx | 8 ++ .../components/EntryReadHistory.tsx | 73 ++++++++++++++++--- 3 files changed, 73 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/components/ui/modal/stacked/modal.tsx b/src/renderer/src/components/ui/modal/stacked/modal.tsx index 183624023..fc1ff77c1 100644 --- a/src/renderer/src/components/ui/modal/stacked/modal.tsx +++ b/src/renderer/src/components/ui/modal/stacked/modal.tsx @@ -6,6 +6,7 @@ import { m } from "@renderer/components/common/Motion" import { ErrorComponentType } from "@renderer/components/errors/enum" import { isElectronBuild } from "@renderer/constants" import { useSwitchHotKeyScope } from "@renderer/hooks/common" +import { debugStack } from "@renderer/lib/dev" import { nextFrame, stopPropagation } from "@renderer/lib/dom" import { cn } from "@renderer/lib/utils" import { useAnimationControls, useDragControls } from "framer-motion" @@ -83,6 +84,7 @@ export const ModalInternal = memo( const onClose = useCallback( (open: boolean): void => { + debugStack() if (!open) { close() } diff --git a/src/renderer/src/lib/dev.tsx b/src/renderer/src/lib/dev.tsx index d8259aa4a..1f9335378 100644 --- a/src/renderer/src/lib/dev.tsx +++ b/src/renderer/src/lib/dev.tsx @@ -53,3 +53,11 @@ export const attachOpenInEditor = (stack: string) => { const openInEditor = (file: string) => { fetch(`/__open-in-editor?file=${encodeURIComponent(`${file}`)}`) } + +export const debugStack = () => { + try { + throw new Error("debug stack") + } catch (e: any) { + console.error(e.stack) + } +} diff --git a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx index 7de541966..af0d7e497 100644 --- a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx +++ b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx @@ -1,3 +1,9 @@ +import { + HoverCard, + HoverCardContent, + HoverCardPortal, + HoverCardTrigger, +} from "@radix-ui/react-hover-card" import { useWhoami } from "@renderer/atoms/user" import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar" import { @@ -10,6 +16,7 @@ import { useAuthQuery } from "@renderer/hooks/common" import { Queries } from "@renderer/queries" import { useEntryReadHistory } from "@renderer/store/entry" import { useUserById } from "@renderer/store/user" +import clsx from "clsx" import { LayoutGroup, m } from "framer-motion" import { memo, useEffect, useState } from "react" @@ -54,29 +61,75 @@ export const EntryReadHistory: Component<{ entryId: string }> = ({ entryId }) => entryHistory.readCount > 10 && entryHistory.userIds && entryHistory.userIds.length >= 10 && ( - - -
+ +
-
- - More - -
+ + + + + +
    + {entryHistory.userIds + .filter((id) => id !== me?.id) + .slice(10) + .map((userId) => ( + + ))} +
+
+
+ )} ) } +const EntryRow: Component<{ userId: string }> = memo(({ userId }) => { + const user = useUserById(userId) + const presentUserProfile = usePresentUserProfileModal("drawer") + if (!user) return null + + return ( +
  • + +
  • + ) +}) + const EntryUser: Component<{ userId: string i: number From 6a8b243c3338a7c866383afb9e4ff845d7d2389a Mon Sep 17 00:00:00 2001 From: Noah <130611693+upupnoah@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:19:31 +0700 Subject: [PATCH 27/66] feat(i18n): add Japanese language support (#404) Added Japanese translations to the application, including localization for app content, common phrases, external resources, language settings, and shortcuts. --- locales/app/ja.json | 207 ++++++++++++++++++++ locales/external/ja.json | 42 ++++ locales/settings/ja.json | 195 ++++++++++++++++++ locales/shortcuts/ja.json | 24 +++ src/renderer/src/@types/constants.ts | 2 - src/renderer/src/@types/default-resource.ts | 3 +- 6 files changed, 469 insertions(+), 4 deletions(-) create mode 100644 locales/app/ja.json create mode 100644 locales/external/ja.json create mode 100644 locales/settings/ja.json create mode 100644 locales/shortcuts/ja.json diff --git a/locales/app/ja.json b/locales/app/ja.json new file mode 100644 index 000000000..6bf78d8fb --- /dev/null +++ b/locales/app/ja.json @@ -0,0 +1,207 @@ +{ + "ai_daily.title": "トップニュース - {{title}}", + "ai_daily.tooltip.content": "こちらは、AIがあなたのタイムラインから選んだニュースです( - )。あなたにとって重要なニュースかもしれません。", + "ai_daily.tooltip.update_schedule": "毎日午前8時と午後8時に更新されます。", + "app.app_name": "APP_NAME", + "app.copy_logo_svg": "ロゴSVGをコピー", + "app.toggle_sidebar": "サイドバーを切り替え", + "discover.any_url_or_keyword": "任意のURLまたはキーワード", + "discover.default_option": " (デフォルト)", + "discover.feed_description": "このフィードの説明は以下の通りです。必要な情報をパラメータフォームに入力してください。", + "discover.feed_maintainers": "このフィードはRSSHubが提供しています。に感謝します。", + "discover.import.click_to_upload": "OPMLファイルをアップロードするにはクリック", + "discover.popular": "人気", + "discover.preview": "プレビュー", + "discover.rss_hub_route": "RSSHubルート", + "discover.rss_url": "RSS URL", + "discover.select_placeholder": "選択", + "early_access": "アーリーアクセス", + "entry_actions.copy_link": "リンクをコピー", + "entry_actions.failed_to_save_to_eagle": "Eagleへの保存に失敗しました。", + "entry_actions.failed_to_save_to_instapaper": "Instapaperへの保存に失敗しました。", + "entry_actions.failed_to_save_to_readwise": "Readwiseへの保存に失敗しました。", + "entry_actions.link_copied": "リンクがクリップボードにコピーされました。", + "entry_actions.mark_as_read": "既読にする", + "entry_actions.mark_as_unread": "未読にする", + "entry_actions.open_in_browser": "ブラウザで開く", + "entry_actions.save_media_to_eagle": "メディアをEagleに保存", + "entry_actions.save_to_instapaper": "Instapaperに保存", + "entry_actions.save_to_readwise": "Readwiseに保存", + "entry_actions.saved_to_eagle": "Eagleに保存されました。", + "entry_actions.saved_to_instapaper": "Instapaperに保存されました。", + "entry_actions.saved_to_readwise": "Readwiseに保存されました。", + "entry_actions.share": "共有", + "entry_actions.star": "スター", + "entry_actions.starred": "スターに登録されました。", + "entry_actions.tip": "チップ", + "entry_actions.unstar": "スターを解除", + "entry_actions.unstarred": "スターが解除されました。", + "entry_column.refreshing": "新しいエントリを更新中...", + "entry_content.ai_summary": "AIによる要約", + "entry_content.fetching_content": "元のコンテンツを取得し、処理中です...", + "entry_content.header.play_tts": "TTSを再生", + "entry_content.header.readability": "読みやすさ", + "entry_content.no_content": "コンテンツがありません", + "entry_content.readability_notice": "このコンテンツはReadabilityにより提供されています。誤字などを発見した場合は、元のサイトでオリジナルのコンテンツをご覧ください。", + "entry_content.render_error": "レンダリングエラー:", + "entry_content.report_issue": "問題を報告", + "entry_content.web_app_notice": "このコンテンツタイプはウェブアプリではサポートされていないかもしれません。デスクトップアプリをダウンロードしてください。", + "entry_list.zero_unread": "未読ゼロ", + "entry_list_header.daily_report": "日報", + "entry_list_header.hide_no_image_items": "画像がないエントリを非表示", + "entry_list_header.items": "項目", + "entry_list_header.new_entries_available": "新しいエントリが利用可能です", + "entry_list_header.refetch": "再取得", + "entry_list_header.refresh": "更新", + "entry_list_header.show_all": "すべて表示", + "entry_list_header.show_all_items": "すべてのエントリを表示", + "entry_list_header.show_unread_only": "未読のみ表示", + "entry_list_header.switch_to_grid": "グリッドに切り替え", + "entry_list_header.switch_to_masonry": "メイソンリーレイアウトに切り替え", + "entry_list_header.unread": "未読", + "feed_claim_modal.choose_verification_method": "選択肢は3つあります。そのうち1つを選んで確認してください。", + "feed_claim_modal.claim_button": "クレーム", + "feed_claim_modal.content_instructions": "以下の内容をコピーして、最新のRSSフィードに投稿してください。", + "feed_claim_modal.description_current": "現在の説明:", + "feed_claim_modal.description_instructions": "次の内容をコピーし、RSSフィードのフィールドに貼り付けてください。", + "feed_claim_modal.failed_to_load": "クレームメッセージの読み込みに失敗しました", + "feed_claim_modal.rss_format_choice": "RSSジェネレータには通常2つのフォーマットがあります。必要に応じて以下のXMLおよびJSONフォーマットをコピーしてください。", + "feed_claim_modal.rss_instructions": "以下のコードをコピーし、RSSジェネレータに貼り付けてください。", + "feed_claim_modal.rss_json_format": "JSONフォーマット", + "feed_claim_modal.rss_xml_format": "XMLフォーマット", + "feed_claim_modal.rsshub_notice": "このフィードはRSSHubによって提供されており、キャッシュ時間は1時間です。コンテンツの変更が反映されるまで最大1時間かかる場合があります。", + "feed_claim_modal.tab_content": "コンテンツ", + "feed_claim_modal.tab_description": "説明", + "feed_claim_modal.tab_rss": "RSSタグ", + "feed_claim_modal.verify_ownership": "このフィードを自分のものとしてクレームするには、所有権を確認する必要があります。", + "feed_form.add_follow": "フォローを追加", + "feed_form.category": "カテゴリー", + "feed_form.category_description": "デフォルトでは、フォローはウェブサイトごとにグループ化されます。", + "feed_form.error_fetching_feed": "フィードの取得に失敗しました。", + "feed_form.feed_not_found": "フィードが見つかりません。", + "feed_form.feedback": "フィードバック", + "feed_form.follow": "フォロー", + "feed_form.followed": "🎉 フォローしました。", + "feed_form.private_follow": "プライベートフォロー", + "feed_form.private_follow_description": "このフォローがあなたのプロフィールページに公開されるかどうか。", + "feed_form.retry": "再試行", + "feed_form.title": "タイトル", + "feed_form.title_description": "このフィードのカスタムタイトル。デフォルトを使用するには空白のままにしてください。", + "feed_form.unfollow": "フォロー解除", + "feed_form.update": "更新", + "feed_form.update_follow": "フォローを更新", + "feed_form.updated": "🎉 更新されました。", + "feed_form.view": "表示", + "feed_item.claimed_by_owner": "このフィードは", + "feed_item.claimed_by_unknown": "その所有者によってクレームされています。", + "feed_item.claimed_by_you": "あなたによってクレームされています", + "feed_item.claimed_feed": "クレームされたフィード", + "feed_item.error_since": "エラー発生時刻", + "feed_item.not_publicly_visible": "プロフィールページに公開されていません", + "feed_view_type.articles": "記事", + "feed_view_type.audios": "オーディオ", + "feed_view_type.notifications": "通知", + "feed_view_type.pictures": "画像", + "feed_view_type.social_media": "ソーシャルメディア", + "feed_view_type.videos": "動画", + "mark_all_read_button.auto_confirm_info": "3秒後に自動的に確認されます。", + "mark_all_read_button.confirm": "確認", + "mark_all_read_button.confirm_mark_all": "{{which}}を既読にしますか?", + "mark_all_read_button.confirm_mark_all_info": "すべてを既読にしますか?", + "mark_all_read_button.mark_all_as_read": "すべてを既読にする", + "mark_all_read_button.mark_as_read": "{{which}}を既読にする", + "mark_all_read_button.undo": "元に戻す", + "player.back_10s": "10秒戻る", + "player.close": "閉じる", + "player.download": "ダウンロード", + "player.exit_full_screen": "フルスクリーンを終了", + "player.forward_10s": "10秒進む", + "player.full_screen": "フルスクリーン", + "player.mute": "ミュート", + "player.open_entry": "エントリを開く", + "player.pause": "一時停止", + "player.play": "再生", + "player.playback_rate": "再生速度", + "player.unmute": "ミュート解除", + "player.volume": "音量", + "search.empty.no_results": "結果が見つかりませんでした。", + "search.group.entries": "エントリ", + "search.group.feeds": "フィード", + "search.options.all": "すべて", + "search.options.entries": "エントリ", + "search.options.feeds": "フィード", + "search.options.search_type": "検索タイプ", + "search.placeholder": "検索...", + "search.result_count_local_mode": "(ローカルモード)", + "search.tooltip.local_search": "この検索は、ローカルで利用可能なデータを対象としています。最新データを含めるために再取得を試してください。", + "shortcuts.guide.title": "ショートカットガイドライン", + "sidebar.category_remove_dialog.cancel": "キャンセル", + "sidebar.category_remove_dialog.continue": "続行", + "sidebar.category_remove_dialog.description": "この操作によりカテゴリーが削除されますが、含まれているフィードは保持され、ウェブサイトごとにグループ化されます。", + "sidebar.category_remove_dialog.title": "カテゴリーを削除", + "sidebar.feed_actions.claim": "クレーム", + "sidebar.feed_actions.claim_feed": "フィードをクレーム", + "sidebar.feed_actions.copy_feed_id": "フィードIDをコピー", + "sidebar.feed_actions.copy_feed_url": "フィードURLをコピー", + "sidebar.feed_actions.edit": "編集", + "sidebar.feed_actions.edit_feed": "フィードを編集", + "sidebar.feed_actions.feed_owned_by_you": "このフィードはあなたが所有しています", + "sidebar.feed_actions.mark_all_as_read": "すべてを既読にする", + "sidebar.feed_actions.navigate_to_feed": "フィードに移動", + "sidebar.feed_actions.open_feed_in_browser": "ブラウザでフィードを開く", + "sidebar.feed_actions.open_site_in_browser": "ブラウザでサイトを開く", + "sidebar.feed_actions.unfollow": "フォロー解除", + "sidebar.feed_actions.unfollow_feed": "フィードのフォローを解除", + "sidebar.feed_column.context_menu.change_to_other_view": "他のビューに切り替え", + "sidebar.feed_column.context_menu.delete_category": "カテゴリーを削除", + "sidebar.feed_column.context_menu.delete_category_confirmation": "カテゴリー{{folderName}}を削除しますか?", + "sidebar.feed_column.context_menu.mark_as_read": "既読にする", + "sidebar.feed_column.context_menu.rename_category": "カテゴリーの名前を変更", + "sidebar.select_sort_method": "並べ替え方法を選択", + "signin.continue_with_github": "GitHubで続ける", + "signin.continue_with_google": "Googleで続ける", + "signin.sign_in_to": "サインイン", + "sync_indicator.disabled": "セキュリティ上の理由により、同期は無効になっています。", + "sync_indicator.offline": "オフライン", + "sync_indicator.synced": "サーバーと同期済み", + "tip_modal.amount": "金額", + "tip_modal.claim_feed": "このフィードをクレーム", + "tip_modal.create_wallet": "無料で作成", + "tip_modal.feed_owner": "フィードの所有者", + "tip_modal.low_balance": "このチップをカバーするには残高が不足しています。金額を調整してください。", + "tip_modal.no_wallet": "まだウォレットがありません。ウォレットを作成してチップを送信してください。", + "tip_modal.tip_amount_sent": "が作者に送信されました。", + "tip_modal.tip_now": "今すぐチップ", + "tip_modal.tip_sent": "チップが正常に送信されました!ご支援ありがとうございます。", + "tip_modal.tip_support": "⭐ サポートを示すためにチップを送る!", + "tip_modal.unclaimed_feed": "このフィードはまだ誰にもクレームされていません。受け取ったPowerは、フィードがクレームされるまでブロックチェーン契約で安全に保持されます。", + "user_button.account": "アカウント", + "user_button.download_desktop_app": "デスクトップアプリをダウンロード", + "user_button.log_out": "ログアウト", + "user_button.power": "Power", + "user_button.preferences": "設定", + "user_button.profile": "プロフィール", + "user_profile.close": "閉じる", + "user_profile.edit": "編集", + "user_profile.loading": "読み込み中", + "user_profile.share": "共有", + "user_profile.toggle_item_style": "アイテムスタイルを切り替え", + "words.add": "追加", + "words.confirm": "確認", + "words.discover": "発見", + "words.email": "メール", + "words.import": "インポート", + "words.items": "アイテム", + "words.language": "言語", + "words.load_archived_entries": "アーカイブされたエントリを読み込む", + "words.login": "ログイン", + "words.rss": "RSS", + "words.rss3": "RSS3", + "words.rsshub": "RSSHub", + "words.search": "検索", + "words.starred": "スター付き", + "words.unread": "未読", + "words.user": "ユーザー", + "words.which.all": "すべて", + "words.zero_items": "アイテムがありません" +} diff --git a/locales/external/ja.json b/locales/external/ja.json new file mode 100644 index 000000000..efa0f30ba --- /dev/null +++ b/locales/external/ja.json @@ -0,0 +1,42 @@ +{ + "feed": { + "follow_one": "フォロー", + "follow_other": "フォロー", + "followsAndReads": "{{appName}} で {{subscriptionCount}} {{subscriptionNoun}} と {{readCount}} {{readNoun}}", + "read_one": "読んだ", + "read_other": "既読" + }, + "header": { + "app": "アプリ", + "download": "ダウンロード" + }, + "invitation": { + "activate": "有効化", + "codeOptions": { + "1": "招待してくれるアルファテストユーザーを探しましょう。", + "2": "時折行われるプレゼント企画のために、私たちのDiscordサーバーに参加しましょう。", + "3": "時折行われるプレゼント企画のために、私たちのXアカウントをフォローしましょう。" + }, + "earlyAccess": "現在、Followはアーリーアクセス中で、利用には招待コードが必要です。", + "earlyAccessMessage": "😰 申し訳ありませんが、Followは現在アーリーアクセス中で、招待コードが必要です。", + "generateButton": "新しいコードを生成", + "generateCost": "友達のために招待コードを生成するには、{{INVITATION_PRICE}} Power を消費できます。", + "getCodeMessage": "以下の方法で招待コードを入手できます:", + "title": "招待コード" + }, + "login": { + "backToWebApp": "ウェブアプリに戻る", + "continueWithGitHub": "GitHubで続行", + "continueWithGoogle": "Googleで続行", + "logInTo": "ログイン ", + "openApp": "アプリを開く", + "redirecting": "リダイレクト中", + "welcomeTo": "ようこそ " + }, + "redirect": { + "continueInBrowser": "ブラウザで続行", + "instruction": "今が{{APP_NAME}}を開き、このページを安全に閉じる時です。", + "openApp": "{{APP_NAME}}を開く", + "successMessage": "{{APP_NAME}}アカウントに正常に接続されました。" + } +} diff --git a/locales/settings/ja.json b/locales/settings/ja.json new file mode 100644 index 000000000..7ce8dcf9c --- /dev/null +++ b/locales/settings/ja.json @@ -0,0 +1,195 @@ +{ + "about.changelog": "変更履歴", + "about.feedbackInfo": "{{appName}} ({{commitSha}}) は開発の初期段階にあります。フィードバックや提案があれば、気軽に GitHubで課題を報告してください 。", + "about.iconLibrary": "使用されているアイコンライブラリは によって著作権が保護されており、再配布できません。", + "about.licenseInfo": "{{appName}} は、常に無料でオープンソースのプロジェクトです。{{license}}の下でライセンスされています。", + "about.sidebar_title": "アバウト", + "about.socialMedia": "ソーシャルメディア", + "actions.actionName": "アクション {{number}}", + "actions.action_card.add": "追加", + "actions.action_card.all": "すべて", + "actions.action_card.block_rules": "ブロックルール", + "actions.action_card.custom_filters": "カスタムフィルター", + "actions.action_card.enable_readability": "読みやすさを有効化", + "actions.action_card.entry_options.all": "すべて", + "actions.action_card.entry_options.author": "著者", + "actions.action_card.entry_options.content": "内容", + "actions.action_card.entry_options.order": "順番", + "actions.action_card.entry_options.title": "タイトル", + "actions.action_card.entry_options.url": "URL", + "actions.action_card.feed_options.category": "カテゴリ", + "actions.action_card.feed_options.feed_url": "フィードURL", + "actions.action_card.feed_options.site_url": "サイトURL", + "actions.action_card.feed_options.title": "タイトル", + "actions.action_card.feed_options.view": "表示", + "actions.action_card.field": "フィールド", + "actions.action_card.from": "から", + "actions.action_card.generate_summary": "AIを使って要約を生成", + "actions.action_card.name": "名前", + "actions.action_card.operation_options.contains": "含む", + "actions.action_card.operation_options.does_not_contain": "含まない", + "actions.action_card.operation_options.is_equal_to": "等しい", + "actions.action_card.operation_options.is_greater_than": "より大きい", + "actions.action_card.operation_options.is_less_than": "より小さい", + "actions.action_card.operation_options.is_not_equal_to": "等しくない", + "actions.action_card.operation_options.matches_regex": "正規表現に一致する", + "actions.action_card.operator": "オペレーター", + "actions.action_card.rewrite_rules": "書き換えルール", + "actions.action_card.then_do": "次に行う…", + "actions.action_card.to": "へ", + "actions.action_card.translate_into": "翻訳する", + "actions.action_card.value": "値", + "actions.action_card.when_feeds_match": "フィードが一致した場合…", + "actions.newRule": "新しいルール", + "actions.save": "保存", + "actions.saveSuccess": "🎉 アクションが保存されました。", + "actions.sidebar_title": "アクション", + "actions.title": "アクション", + "appearance.code_highlight_theme": "コードハイライトテーマ", + "appearance.content": "コンテンツ", + "appearance.content_font": "コンテンツフォント", + "appearance.custom_font": "カスタムフォント", + "appearance.fonts": "フォント", + "appearance.general": "一般", + "appearance.guess_code_language.description": "ラベルがないコードブロックの言語を推測するためにモデルを使用する主要なプログラミング言語", + "appearance.guess_code_language.label": "コード言語を推測", + "appearance.misc": "その他", + "appearance.modal_overlay.description": "モーダルオーバーレイを表示", + "appearance.modal_overlay.label": "モーダルオーバーレイを表示", + "appearance.opaque_sidebars.label": "不透明なサイドバー", + "appearance.reader_render_inline_style.description": "オリジナルHTMLのインラインスタイルをレンダリングします。", + "appearance.reader_render_inline_style.label": "インラインスタイルをレンダリング", + "appearance.reduce_motion.description": "要素の動きを減らして、パフォーマンスを向上させ、エネルギー消費を抑えます", + "appearance.reduce_motion.label": "動きを減らす", + "appearance.save": "保存", + "appearance.show_dock_badge.label": "Dockバッジとして表示", + "appearance.sidebar_show_unread_count.label": "サイドバーに表示", + "appearance.sidebar_title": "外観", + "appearance.text_size": "テキストサイズ", + "appearance.theme.dark": "ダーク", + "appearance.theme.label": "テーマ", + "appearance.theme.light": "ライト", + "appearance.theme.system": "システム", + "appearance.title": "外観", + "appearance.ui_font": "UIフォント", + "appearance.unread_count": "未読数", + "general.app": "アプリ", + "general.data_persist.description": "ローカルデータを保持してオフラインアクセスとローカル検索を可能にします。", + "general.data_persist.label": "オフライン使用のためにデータを保持", + "general.group_by_date.description": "エントリを日付ごとにグループ化します。", + "general.group_by_date.label": "日付ごとにグループ化", + "general.language": "言語", + "general.launch_at_login": "ログイン時に起動", + "general.mark_as_read.hover.description": "ホバー時にエントリを自動的に既読にします。", + "general.mark_as_read.hover.label": "ホバー時に既読にする", + "general.mark_as_read.render.description": "表示されると、単一レベルのエントリ(例:ソーシャルメディアの投稿、画像、動画)が自動的に既読になります。", + "general.mark_as_read.render.label": "表示中に既読にする", + "general.mark_as_read.scroll.description": "表示からスクロールアウトしたときにエントリを自動的に既読にします。", + "general.mark_as_read.scroll.label": "スクロール時に既読にする", + "general.privacy_data": "プライバシーとデータ", + "general.rebuild_database.button": "再構築", + "general.rebuild_database.description": "レンダリングに問題がある場合、データベースの再構築が解決するかもしれません。", + "general.rebuild_database.label": "データベースを再構築", + "general.rebuild_database.title": "データベースを再構築", + "general.rebuild_database.warning.line1": "データベースの再構築により、すべてのローカルデータが消去されます。", + "general.rebuild_database.warning.line2": "本当に続行しますか?", + "general.send_anonymous_data.description": "匿名化されたテレメトリーデータを送信することにより、Followの全体的なユーザーエクスペリエンスの向上に貢献します。", + "general.send_anonymous_data.label": "匿名データを送信", + "general.show_unread_on_launch.description": "起動時に未読コンテンツを表示", + "general.show_unread_on_launch.label": "起動時に未読コンテンツを表示", + "general.sidebar_title": "一般", + "general.timeline": "タイムライン", + "general.unread": "未読", + "general.voices": "音声", + "integration.eagle.enable.description": "利用可能な場合、'Eagleにメディアを保存' ボタンを表示します。", + "integration.eagle.enable.label": "有効化", + "integration.eagle.title": "Eagle", + "integration.instapaper.enable.description": "利用可能な場合、'Instapaperに保存' ボタンを表示します。", + "integration.instapaper.enable.label": "有効化", + "integration.instapaper.password.label": "Instapaperパスワード", + "integration.instapaper.title": "Instapaper", + "integration.instapaper.username.label": "Instapaperユーザー名", + "integration.readwise.enable.description": "利用可能な場合、'Readwiseに保存' ボタンを表示します。", + "integration.readwise.enable.label": "有効化", + "integration.readwise.title": "Readwise", + "integration.readwise.token.description": "こちらで取得できます: readwise.io/access_token.", + "integration.readwise.token.label": "Readwiseアクセス トークン", + "integration.sidebar_title": "統合", + "integration.tip": "ヒント: あなたの機密データはローカルに保存され、サーバーにアップロードされません。", + "integration.title": "統合", + "invitation.activate": "アクティベート", + "invitation.codeOptions.betaUser": "1. ベータユーザーから招待を受ける。", + "invitation.codeOptions.discord": "2. Discordサーバーに参加して、時々プレゼントをもらいましょう。", + "invitation.codeOptions.xAccount": "3. Xアカウントをフォローして、時々プレゼントをもらいましょう。", + "invitation.confirmModal.cancel": "キャンセル", + "invitation.confirmModal.confirm": "続けますか?", + "invitation.confirmModal.continue": "続行", + "invitation.confirmModal.message": "招待コードを生成するには、{{INVITATION_PRICE}} Powerが必要です。", + "invitation.confirmModal.title": "確認", + "invitation.earlyAccess": "現在、Followはアーリーアクセス中で、招待コードが必要です。", + "invitation.earlyAccessMessage": "😰 申し訳ありません。Followは現在アーリーアクセス中で、招待コードが必要です。", + "invitation.generateButton": "新しいコードを生成", + "invitation.generateCost": "{{INVITATION_PRICE}} Powerを消費して、友達のために招待コードを生成できます。", + "invitation.getCodeMessage": "以下の方法で招待コードを取得できます:", + "invitation.newInvitationSuccess": "🎉 新しい招待コードが生成され、クリップボードにコピーされました", + "invitation.noInvitations": "招待はありません", + "invitation.notUsed": "未使用", + "invitation.sidebar_title": "招待", + "invitation.tableHeaders.code": "コード", + "invitation.tableHeaders.creationTime": "作成時間", + "invitation.tableHeaders.usedBy": "使用者", + "invitation.title": "招待コード", + "profile.avatar.label": "アバター", + "profile.handle.description": "あなたの一意の識別子。", + "profile.handle.label": "ハンドル", + "profile.name.description": "公開表示名。", + "profile.name.label": "表示名", + "profile.sidebar_title": "プロフィール", + "profile.submit": "送信", + "profile.title": "プロフィール設定", + "profile.updateSuccess": "プロフィールが更新されました。", + "titles.about": "アバウト", + "titles.actions": "アクション", + "titles.appearance": "外観", + "titles.general": "一般", + "titles.integration": "統合", + "titles.invitations": "招待", + "titles.power": "Power", + "titles.profile": "プロフィール", + "titles.shortcuts": "ショートカット", + "wallet.address.title": "あなたのアドレス", + "wallet.balance.title": "残高", + "wallet.balance.withdrawable": "引き出し可能", + "wallet.balance.withdrawableTooltip": "引き出し可能なPowerには、受け取ったチップと、再チャージしたPowerの両方が含まれます。", + "wallet.claim.button.claim": "デイリーパワーを取得", + "wallet.claim.button.claimed": "今日取得済み", + "wallet.claim.tooltip.alreadyClaimed": "今日はすでに取得済みです。", + "wallet.claim.tooltip.canClaim": "{{amount}}のデイリーパワーを今すぐ取得しましょう!", + "wallet.create.button": "ウォレットを作成", + "wallet.create.description": " Powerを受け取るための無料ウォレットを作成し、クリエイターを報酬したり、コンテンツ貢献で報酬を得ることができます。", + "wallet.power.dailyClaim": "毎日{{amount}}の無料Powerを取得でき、それを使ってFollowのRSSエントリにチップを送ることができます。", + "wallet.power.description": "Powerは、{{blockchainName}}ブロックチェーン上のERC-20トークンです。", + "wallet.sidebar_title": "Power", + "wallet.transactions.amount": "金額", + "wallet.transactions.date": "日付", + "wallet.transactions.from": "送信元", + "wallet.transactions.noTransactions": "トランザクションなし", + "wallet.transactions.title": "トランザクション", + "wallet.transactions.to": "送信先", + "wallet.transactions.tx": "取引ID", + "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.you": "あなた", + "wallet.withdraw.addressLabel": "あなたのEthereumアドレス", + "wallet.withdraw.amountLabel": "金額", + "wallet.withdraw.availableBalance": "引き出し可能なPowerはです。", + "wallet.withdraw.button": "引き出し", + "wallet.withdraw.error": "引き出しに失敗しました: {{error}}", + "wallet.withdraw.modalTitle": "Powerを引き出す", + "wallet.withdraw.submitButton": "送信", + "wallet.withdraw.success": "引き出しが成功しました!" +} diff --git a/locales/shortcuts/ja.json b/locales/shortcuts/ja.json new file mode 100644 index 000000000..da18f7139 --- /dev/null +++ b/locales/shortcuts/ja.json @@ -0,0 +1,24 @@ +{ + "keys.audio.playPause": "再生/一時停止(オーディオプレーヤーが開いているとき)", + "keys.entries.markAllAsRead": "すべて既読にする", + "keys.entries.next": "次のエントリ", + "keys.entries.previous": "前のエントリ", + "keys.entries.refetch": "再取得", + "keys.entries.toggleUnreadOnly": "未読のみ切り替え", + "keys.entry.copyLink": "リンクをコピー", + "keys.entry.openInBrowser": "ブラウザで開く", + "keys.entry.openInNewTab": "新しいタブで開く", + "keys.entry.scrollDown": "下にスクロール", + "keys.entry.scrollUp": "上にスクロール", + "keys.entry.share": "共有", + "keys.entry.tip": "チップを送る", + "keys.entry.toggleRead": "既読/未読の切り替え", + "keys.entry.toggleStarred": "スターの切り替え", + "keys.entry.tts": "TTSを再生", + "keys.feeds.add": "購読を追加", + "keys.feeds.switchBetweenViews": "ビューを切り替え", + "keys.feeds.switchToView": "ビューに切り替え", + "keys.layout.showShortcuts": "ショートカットを表示/非表示", + "keys.layout.toggleSidebar": "フィードサイドバーの表示/非表示", + "sidebar_title": "ショートカット" +} diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index cb4c6e193..666e864b3 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -1,11 +1,9 @@ const langs = ["en", "ja", "zh-CN"] export const currentSupportedLanguages = langs.sort() - export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], ["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")], ["ja"]: ["ja", () => import("dayjs/locale/ja")], } - export const ns = ["app", "common", "lang", "settings", "shortcuts"] as const export const defaultNS = "app" as const diff --git a/src/renderer/src/@types/default-resource.ts b/src/renderer/src/@types/default-resource.ts index 28c271ac8..752f765b7 100644 --- a/src/renderer/src/@types/default-resource.ts +++ b/src/renderer/src/@types/default-resource.ts @@ -8,7 +8,6 @@ import lang_ja from "../../../../locales/lang/ja.json" import lang_zhCN from "../../../../locales/lang/zh-CN.json" import settings_en from "../../../../locales/settings/en.json" import shortcuts_en from "../../../../locales/shortcuts/en.json" - /** * This file is the language resource that is loaded in full when the app is initialized. * When switching languages, the app will automatically download the required language resources, @@ -16,7 +15,6 @@ import shortcuts_en from "../../../../locales/shortcuts/en.json" * Generally, we only load english resources synchronously by default. * In addition, we attach common resources for other languages, and the size of the common resources must be controlled. */ - export const defaultResources = { en: { app: en, @@ -34,4 +32,5 @@ export const defaultResources = { lang: lang_ja, common: common_ja, }, + ja: { lang: lang_ja, common: common_ja }, } From d624c43d1b9efabd927db4ff9af79afe009cf9a0 Mon Sep 17 00:00:00 2001 From: Noah <130611693+upupnoah@users.noreply.github.com> Date: Sat, 14 Sep 2024 18:32:07 +0700 Subject: [PATCH 28/66] feat(i18n): add Portuguese language support (#406) Added Portuguese translations to the application, including localization for app content, common phrases, external resources, language settings, and shortcuts. Co-authored-by: Innei --- locales/app/pt.json | 207 ++++++++++++++++++++ locales/common/pt.json | 28 +++ locales/external/pt.json | 42 ++++ locales/lang/en.json | 1 + locales/lang/ja.json | 1 + locales/lang/pt.json | 7 + locales/lang/zh-CN.json | 1 + locales/settings/pt.json | 195 ++++++++++++++++++ locales/shortcuts/pt.json | 24 +++ src/renderer/src/@types/constants.ts | 3 +- src/renderer/src/@types/default-resource.ts | 3 + 11 files changed, 511 insertions(+), 1 deletion(-) create mode 100644 locales/app/pt.json create mode 100644 locales/common/pt.json create mode 100644 locales/external/pt.json create mode 100644 locales/lang/pt.json create mode 100644 locales/settings/pt.json create mode 100644 locales/shortcuts/pt.json diff --git a/locales/app/pt.json b/locales/app/pt.json new file mode 100644 index 000000000..3b911ea37 --- /dev/null +++ b/locales/app/pt.json @@ -0,0 +1,207 @@ +{ + "ai_daily.title": "Principais Notícias - {{title}}", + "ai_daily.tooltip.content": "Aqui estão as notícias selecionadas pela IA da sua linha do tempo ( - ), que podem ser importantes para si.", + "ai_daily.tooltip.update_schedule": "Atualizações diárias às 8h00 e às 20h00.", + "app.app_name": "NOME_APP", + "app.copy_logo_svg": "Copiar Logo SVG", + "app.toggle_sidebar": "Alternar Barra Lateral", + "discover.any_url_or_keyword": "Qualquer URL ou Palavra-chave", + "discover.default_option": " (padrão)", + "discover.feed_description": "A descrição deste feed é a seguinte, e pode preencher o formulário de parâmetros com as informações relevantes.", + "discover.feed_maintainers": "Este feed é fornecido por RSSHub, com créditos para ", + "discover.import.click_to_upload": "Clique para carregar o ficheiro OPML", + "discover.popular": "Popular", + "discover.preview": "Pré-visualizar", + "discover.rss_hub_route": "Rota RSSHub", + "discover.rss_url": "URL do RSS", + "discover.select_placeholder": "Selecionar", + "early_access": "Acesso Antecipado", + "entry_actions.copy_link": "Copiar link", + "entry_actions.failed_to_save_to_eagle": "Falha ao guardar no Eagle.", + "entry_actions.failed_to_save_to_instapaper": "Falha ao guardar no Instapaper.", + "entry_actions.failed_to_save_to_readwise": "Falha ao guardar no Readwise.", + "entry_actions.link_copied": "Link copiado para a área de transferência.", + "entry_actions.mark_as_read": "Marcar como lido", + "entry_actions.mark_as_unread": "Marcar como não lido", + "entry_actions.open_in_browser": "Abrir no navegador", + "entry_actions.save_media_to_eagle": "Guardar mídia no Eagle", + "entry_actions.save_to_instapaper": "Guardar no Instapaper", + "entry_actions.save_to_readwise": "Guardar no Readwise", + "entry_actions.saved_to_eagle": "Guardado no Eagle.", + "entry_actions.saved_to_instapaper": "Guardado no Instapaper.", + "entry_actions.saved_to_readwise": "Guardado no Readwise.", + "entry_actions.share": "Partilhar", + "entry_actions.star": "Favorito", + "entry_actions.starred": "Favoritado.", + "entry_actions.tip": "Dica", + "entry_actions.unstar": "Remover favorito", + "entry_actions.unstarred": "Favorito removido.", + "entry_column.refreshing": "A atualizar entradas...", + "entry_content.ai_summary": "Resumo IA", + "entry_content.fetching_content": "A obter conteúdo original e a processar...", + "entry_content.header.play_tts": "Reproduzir TTS", + "entry_content.header.readability": "Legibilidade", + "entry_content.no_content": "Sem conteúdo", + "entry_content.readability_notice": "Este conteúdo é fornecido pela Readability. Se encontrar erros tipográficos, consulte o site de origem para ver o conteúdo original.", + "entry_content.render_error": "Erro ao renderizar:", + "entry_content.report_issue": "Relatar problema", + "entry_content.web_app_notice": "Talvez a aplicação web não suporte este tipo de conteúdo. Pode fazer o download da aplicação para desktop.", + "entry_list.zero_unread": "Sem não lidos", + "entry_list_header.daily_report": "Relatório Diário", + "entry_list_header.hide_no_image_items": "Ocultar entradas sem imagens", + "entry_list_header.items": "itens", + "entry_list_header.new_entries_available": "Novas entradas disponíveis", + "entry_list_header.refetch": "Recarregar", + "entry_list_header.refresh": "Atualizar", + "entry_list_header.show_all": "Mostrar tudo", + "entry_list_header.show_all_items": "Mostrar todas as entradas", + "entry_list_header.show_unread_only": "Mostrar apenas não lidos", + "entry_list_header.switch_to_grid": "Mudar para grelha", + "entry_list_header.switch_to_masonry": "Mudar para layout de alvenaria", + "entry_list_header.unread": "não lidos", + "feed_claim_modal.choose_verification_method": "Existem três métodos de verificação. Pode escolher um para confirmar.", + "feed_claim_modal.claim_button": "Reivindicar", + "feed_claim_modal.content_instructions": "Copie o conteúdo abaixo e publique-o no seu feed RSS mais recente.", + "feed_claim_modal.description_current": "Descrição atual:", + "feed_claim_modal.description_instructions": "Copie o seguinte conteúdo e cole-o no campo do seu feed RSS.", + "feed_claim_modal.failed_to_load": "Falha ao carregar a mensagem de reivindicação", + "feed_claim_modal.rss_format_choice": "Os geradores de RSS geralmente têm dois formatos. Por favor, copie os formatos XML e JSON conforme necessário.", + "feed_claim_modal.rss_instructions": "Copie o código abaixo e cole-o no seu gerador de RSS.", + "feed_claim_modal.rss_json_format": "Formato JSON", + "feed_claim_modal.rss_xml_format": "Formato XML", + "feed_claim_modal.rsshub_notice": "Este feed é fornecido pelo RSSHub com um tempo de cache de 1 hora. Por favor, aguarde até 1 hora para que as alterações apareçam após a publicação do conteúdo.", + "feed_claim_modal.tab_content": "Conteúdo", + "feed_claim_modal.tab_description": "Descrição", + "feed_claim_modal.tab_rss": "Tag RSS", + "feed_claim_modal.verify_ownership": "Para reivindicar este feed como seu, precisa de verificar a propriedade.", + "feed_form.add_follow": "Adicionar seguir", + "feed_form.category": "Categoria", + "feed_form.category_description": "Por padrão, os seus feeds seguidos serão agrupados por site.", + "feed_form.error_fetching_feed": "Erro ao obter o feed.", + "feed_form.feed_not_found": "Feed não encontrado.", + "feed_form.feedback": "Comentários", + "feed_form.follow": "Seguir", + "feed_form.followed": "🎉 Seguido.", + "feed_form.private_follow": "Seguir em privado", + "feed_form.private_follow_description": "Se este seguimento será ou não visível publicamente no seu perfil.", + "feed_form.retry": "Tentar novamente", + "feed_form.title": "Título", + "feed_form.title_description": "Título personalizado para este feed. Deixe em branco para usar o padrão.", + "feed_form.unfollow": "Deixar de seguir", + "feed_form.update": "Atualizar", + "feed_form.update_follow": "Atualizar seguir", + "feed_form.updated": "🎉 Atualizado.", + "feed_form.view": "Ver", + "feed_item.claimed_by_owner": "Este feed foi reivindicado por", + "feed_item.claimed_by_unknown": "o proprietário.", + "feed_item.claimed_by_you": "Reivindicado por si", + "feed_item.claimed_feed": "Feed reivindicado", + "feed_item.error_since": "Erro desde", + "feed_item.not_publicly_visible": "Não visível publicamente no seu perfil", + "feed_view_type.articles": "Artigos", + "feed_view_type.audios": "Áudios", + "feed_view_type.notifications": "Notificações", + "feed_view_type.pictures": "Imagens", + "feed_view_type.social_media": "Redes Sociais", + "feed_view_type.videos": "Vídeos", + "mark_all_read_button.auto_confirm_info": "Será confirmado automaticamente após 3 segundos.", + "mark_all_read_button.confirm": "Confirmar", + "mark_all_read_button.confirm_mark_all": "Marcar {{which}} como lido?", + "mark_all_read_button.confirm_mark_all_info": "Confirmar marcar tudo como lido?", + "mark_all_read_button.mark_all_as_read": "Marcar tudo como lido", + "mark_all_read_button.mark_as_read": "Marcar {{which}} como lido", + "mark_all_read_button.undo": "Desfazer", + "player.back_10s": "Voltar 10s", + "player.close": "Fechar", + "player.download": "Download", + "player.exit_full_screen": "Sair de ecrã completo", + "player.forward_10s": "Avançar 10s", + "player.full_screen": "Ecrã completo", + "player.mute": "Silenciar", + "player.open_entry": "Abrir entrada", + "player.pause": "Pausar", + "player.play": "Reproduzir", + "player.playback_rate": "Velocidade de reprodução", + "player.unmute": "Ativar som", + "player.volume": "Volume", + "search.empty.no_results": "Nenhum resultado encontrado.", + "search.group.entries": "Entradas", + "search.group.feeds": "Feeds", + "search.options.all": "Todos", + "search.options.entries": "Entradas", + "search.options.feeds": "Feeds", + "search.options.search_type": "Tipo de pesquisa", + "search.placeholder": "Pesquisar...", + "search.result_count_local_mode": "(Modo local)", + "search.tooltip.local_search": "Esta pesquisa abrange os dados disponíveis localmente. Tente recarregar para incluir os dados mais recentes.", + "shortcuts.guide.title": "Guia de Atalhos", + "sidebar.category_remove_dialog.cancel": "Cancelar", + "sidebar.category_remove_dialog.continue": "Continuar", + "sidebar.category_remove_dialog.description": "Esta operação vai apagar a sua categoria, mas os feeds que ela contém serão mantidos e agrupados por site.", + "sidebar.category_remove_dialog.title": "Remover Categoria", + "sidebar.feed_actions.claim": "Reivindicar", + "sidebar.feed_actions.claim_feed": "Reivindicar Feed", + "sidebar.feed_actions.copy_feed_id": "Copiar ID do feed", + "sidebar.feed_actions.copy_feed_url": "Copiar URL do feed", + "sidebar.feed_actions.edit": "Editar", + "sidebar.feed_actions.edit_feed": "Editar feed", + "sidebar.feed_actions.feed_owned_by_you": "Este feed pertence a si", + "sidebar.feed_actions.mark_all_as_read": "Marcar tudo como lido", + "sidebar.feed_actions.navigate_to_feed": "Navegar para o feed", + "sidebar.feed_actions.open_feed_in_browser": "Abrir feed no navegador", + "sidebar.feed_actions.open_site_in_browser": "Abrir site no navegador", + "sidebar.feed_actions.unfollow": "Deixar de seguir", + "sidebar.feed_actions.unfollow_feed": "Deixar de seguir feed", + "sidebar.feed_column.context_menu.change_to_other_view": "Mudar para outro modo de visualização", + "sidebar.feed_column.context_menu.delete_category": "Apagar categoria", + "sidebar.feed_column.context_menu.delete_category_confirmation": "Apagar categoria {{folderName}}?", + "sidebar.feed_column.context_menu.mark_as_read": "Marcar como lido", + "sidebar.feed_column.context_menu.rename_category": "Renomear categoria", + "sidebar.select_sort_method": "Selecionar método de ordenação", + "signin.continue_with_github": "Continuar com o GitHub", + "signin.continue_with_google": "Continuar com o Google", + "signin.sign_in_to": "Iniciar sessão em", + "sync_indicator.disabled": "Por motivos de segurança, a sincronização está desativada.", + "sync_indicator.offline": "Offline", + "sync_indicator.synced": "Sincronizado com o servidor", + "tip_modal.amount": "Quantia", + "tip_modal.claim_feed": "Reivindicar este feed", + "tip_modal.create_wallet": "Criar Grátis", + "tip_modal.feed_owner": "Proprietário do Feed", + "tip_modal.low_balance": "O seu saldo não é suficiente para cobrir esta dica. Por favor, ajuste a quantia.", + "tip_modal.no_wallet": "Ainda não tem uma carteira. Por favor, crie uma carteira para enviar dicas.", + "tip_modal.tip_amount_sent": "foi enviado ao autor.", + "tip_modal.tip_now": "Enviar Dica Agora", + "tip_modal.tip_sent": "Dica enviada com sucesso! Obrigado pelo seu apoio.", + "tip_modal.tip_support": "⭐ Envie uma dica para mostrar o seu apoio!", + "tip_modal.unclaimed_feed": "Ninguém reivindicou este feed ainda. O Power recebido será mantido em segurança no contrato blockchain até ser reivindicado.", + "user_button.account": "Conta", + "user_button.download_desktop_app": "Descarregar aplicação para desktop", + "user_button.log_out": "Terminar sessão", + "user_button.power": "Power", + "user_button.preferences": "Preferências", + "user_button.profile": "Perfil", + "user_profile.close": "Fechar", + "user_profile.edit": "Editar", + "user_profile.loading": "A carregar", + "user_profile.share": "Partilhar", + "user_profile.toggle_item_style": "Alternar Estilo de Item", + "words.add": "Adicionar", + "words.confirm": "Confirmar", + "words.discover": "Descobrir", + "words.email": "E-mail", + "words.import": "Importar", + "words.items": "Itens", + "words.language": "Idioma", + "words.load_archived_entries": "Carregar entradas arquivadas", + "words.login": "Iniciar sessão", + "words.rss": "RSS", + "words.rss3": "RSS3", + "words.rsshub": "RSSHub", + "words.search": "Pesquisar", + "words.starred": "Favoritos", + "words.unread": "Não lidos", + "words.user": "Utilizador", + "words.which.all": "todos", + "words.zero_items": "Sem itens" +} diff --git a/locales/common/pt.json b/locales/common/pt.json new file mode 100644 index 000000000..ae59627f5 --- /dev/null +++ b/locales/common/pt.json @@ -0,0 +1,28 @@ +{ + "app.copied_to_clipboard": "Copiado para a área de transferência", + "cancel": "Cancelar", + "confirm": "Confirmar", + "ok": "OK", + "quantifier.piece": "", + "time.last_night": "Ontem à noite", + "time.the_night_before_last": "Anteontem à noite", + "time.today": "Hoje", + "time.yesterday": "Ontem", + "tips.load-lng-error": "Falha ao carregar o pacote de idioma", + "words.back": "Voltar", + "words.copy": "Copiar", + "words.edit": "Editar", + "words.entry": "Entrada", + "words.id": "ID", + "words.items_one": "Item", + "words.items_other": "Itens", + "words.local": "local", + "words.record": "registo", + "words.record_one": "registo", + "words.record_other": "registos", + "words.result": "resultado", + "words.result_one": "resultado", + "words.result_other": "resultados", + "words.space": " ", + "words.which.all": "Todos" +} diff --git a/locales/external/pt.json b/locales/external/pt.json new file mode 100644 index 000000000..a1bf83f35 --- /dev/null +++ b/locales/external/pt.json @@ -0,0 +1,42 @@ +{ + "feed": { + "follow_one": "seguir", + "follow_other": "seguimentos", + "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} com {{readCount}} {{readNoun}} no {{appName}}", + "read_one": "leitura", + "read_other": "leituras" + }, + "header": { + "app": "App", + "download": "Descarregar" + }, + "invitation": { + "activate": "Ativar", + "codeOptions": { + "1": "Procure um utilizador de teste alpha que o convide.", + "2": "Junte-se ao nosso servidor Discord para receber ofertas ocasionais.", + "3": "Siga a nossa conta no X para receber ofertas ocasionais." + }, + "earlyAccess": "O Follow está atualmente em acesso antecipado e requer um código de convite para ser utilizado.", + "earlyAccessMessage": "😰 Lamentamos, o Follow está atualmente em acesso antecipado e requer um código de convite.", + "generateButton": "Gerar novo código", + "generateCost": "Pode gastar {{INVITATION_PRICE}} Power para gerar um código de convite para os seus amigos.", + "getCodeMessage": "Pode obter um código de convite das seguintes maneiras:", + "title": "Código de Convite" + }, + "login": { + "backToWebApp": "Voltar à App Web", + "continueWithGitHub": "Continuar com GitHub", + "continueWithGoogle": "Continuar com Google", + "logInTo": "Iniciar sessão em ", + "openApp": "Abrir Aplicação", + "redirecting": "A redirecionar", + "welcomeTo": "Bem-vindo ao " + }, + "redirect": { + "continueInBrowser": "Continuar no Navegador", + "instruction": "Agora é o momento de abrir {{APP_NAME}} e fechar esta página com segurança.", + "openApp": "Abrir {{APP_NAME}}", + "successMessage": "Conectou-se com sucesso à conta {{APP_NAME}}." + } +} diff --git a/locales/lang/en.json b/locales/lang/en.json index 795047911..157ca431f 100644 --- a/locales/lang/en.json +++ b/locales/lang/en.json @@ -1,6 +1,7 @@ { "langs.en": "English", "langs.ja": "日本語", + "langs.pt": "Português", "langs.zh-CN": "简体中文", "name": "English" } diff --git a/locales/lang/ja.json b/locales/lang/ja.json index cdd1c6e6c..92d8fcf86 100644 --- a/locales/lang/ja.json +++ b/locales/lang/ja.json @@ -1,6 +1,7 @@ { "langs.en": "English", "langs.ja": "日本語", + "langs.pt": "Português", "langs.zh-CN": "简体中文", "name": "日本語" } diff --git a/locales/lang/pt.json b/locales/lang/pt.json new file mode 100644 index 000000000..fcb92f119 --- /dev/null +++ b/locales/lang/pt.json @@ -0,0 +1,7 @@ +{ + "langs.en": "English", + "langs.ja": "日本語", + "langs.pt": "Português", + "langs.zh-CN": "简体中文", + "name": "Português" +} diff --git a/locales/lang/zh-CN.json b/locales/lang/zh-CN.json index 48ce191a7..aef3b390b 100644 --- a/locales/lang/zh-CN.json +++ b/locales/lang/zh-CN.json @@ -1,6 +1,7 @@ { "langs.en": "English", "langs.ja": "日本語", + "langs.pt": "Português", "langs.zh-CN": "简体中文", "name": "简体中文" } diff --git a/locales/settings/pt.json b/locales/settings/pt.json new file mode 100644 index 000000000..8f3514d3b --- /dev/null +++ b/locales/settings/pt.json @@ -0,0 +1,195 @@ +{ + "about.changelog": "Histórico de Alterações", + "about.feedbackInfo": "{{appName}} ({{commitSha}}) está nas fases iniciais de desenvolvimento. Se tiver algum feedback ou sugestão, fique à vontade para abrir uma issue no nosso GitHub.", + "about.iconLibrary": "A biblioteca de ícones utilizada é protegida por direitos de autor por e não pode ser redistribuída.", + "about.licenseInfo": "{{appName}} é e sempre será um projeto gratuito e de código aberto. Está licenciado sob {{license}}.", + "about.sidebar_title": "Sobre", + "about.socialMedia": "Redes Sociais", + "actions.actionName": "Ação {{number}}", + "actions.action_card.add": "Adicionar", + "actions.action_card.all": "Tudo", + "actions.action_card.block_rules": "Regras de Bloqueio", + "actions.action_card.custom_filters": "Filtros Personalizados", + "actions.action_card.enable_readability": "Ativar legibilidade", + "actions.action_card.entry_options.all": "Tudo", + "actions.action_card.entry_options.author": "Autor", + "actions.action_card.entry_options.content": "Conteúdo", + "actions.action_card.entry_options.order": "Ordem", + "actions.action_card.entry_options.title": "Título", + "actions.action_card.entry_options.url": "Url", + "actions.action_card.feed_options.category": "Categoria", + "actions.action_card.feed_options.feed_url": "URL do Feed", + "actions.action_card.feed_options.site_url": "URL do Site", + "actions.action_card.feed_options.title": "Título", + "actions.action_card.feed_options.view": "Visualizar", + "actions.action_card.field": "Campo", + "actions.action_card.from": "De", + "actions.action_card.generate_summary": "Gerar resumo com IA", + "actions.action_card.name": "Nome", + "actions.action_card.operation_options.contains": "contém", + "actions.action_card.operation_options.does_not_contain": "não contém", + "actions.action_card.operation_options.is_equal_to": "é igual a", + "actions.action_card.operation_options.is_greater_than": "é maior que", + "actions.action_card.operation_options.is_less_than": "é menor que", + "actions.action_card.operation_options.is_not_equal_to": "não é igual a", + "actions.action_card.operation_options.matches_regex": "corresponde ao regex", + "actions.action_card.operator": "Operador", + "actions.action_card.rewrite_rules": "Reescrever Regras", + "actions.action_card.then_do": "Então faz…", + "actions.action_card.to": "Para", + "actions.action_card.translate_into": "Traduzir para", + "actions.action_card.value": "Valor", + "actions.action_card.when_feeds_match": "Quando os feeds corresponderem…", + "actions.newRule": "Nova Regra", + "actions.save": "Guardar", + "actions.saveSuccess": "🎉 Ações guardadas.", + "actions.sidebar_title": "Ações", + "actions.title": "Ações", + "appearance.code_highlight_theme": "Tema de destaque de código", + "appearance.content": "Conteúdo", + "appearance.content_font": "Fonte do conteúdo", + "appearance.custom_font": "Fonte personalizada", + "appearance.fonts": "Fontes", + "appearance.general": "Geral", + "appearance.guess_code_language.description": "Principais linguagens de programação que utilizam modelos para inferir blocos de código não rotulados", + "appearance.guess_code_language.label": "Adivinhar linguagem de código", + "appearance.misc": "Vários", + "appearance.modal_overlay.description": "Mostrar sobreposição modal", + "appearance.modal_overlay.label": "Mostrar sobreposição modal", + "appearance.opaque_sidebars.label": "Barras laterais opacas", + "appearance.reader_render_inline_style.description": "Permite renderizar o estilo inline do HTML original.", + "appearance.reader_render_inline_style.label": "Renderizar estilo inline", + "appearance.reduce_motion.description": "Reduzir o movimento dos elementos para melhorar o desempenho e reduzir o consumo de energia", + "appearance.reduce_motion.label": "Reduzir movimento", + "appearance.save": "Guardar", + "appearance.show_dock_badge.label": "Mostrar como badge no Dock", + "appearance.sidebar_show_unread_count.label": "Mostrar na barra lateral", + "appearance.sidebar_title": "Aparência", + "appearance.text_size": "Tamanho do texto", + "appearance.theme.dark": "Escuro", + "appearance.theme.label": "Tema", + "appearance.theme.light": "Claro", + "appearance.theme.system": "Sistema", + "appearance.title": "Aparência", + "appearance.ui_font": "Fonte da interface", + "appearance.unread_count": "Contagem de não lidos", + "general.app": "App", + "general.data_persist.description": "Guardar os dados localmente para permitir o acesso offline e pesquisa local.", + "general.data_persist.label": "Guardar dados para uso offline", + "general.group_by_date.description": "Agrupar entradas por data.", + "general.group_by_date.label": "Agrupar por data", + "general.language": "Idioma", + "general.launch_at_login": "Lançar ao iniciar sessão", + "general.mark_as_read.hover.description": "Marcar automaticamente as entradas como lidas quando passar o rato sobre elas.", + "general.mark_as_read.hover.label": "Marcar como lido ao passar o rato", + "general.mark_as_read.render.description": "Marcar automaticamente as entradas de nível único (por exemplo, posts em redes sociais, imagens, vídeos visualizados) como lidas quando aparecerem.", + "general.mark_as_read.render.label": "Marcar como lido ao visualizar", + "general.mark_as_read.scroll.description": "Marcar automaticamente as entradas como lidas quando saem do campo de visão.", + "general.mark_as_read.scroll.label": "Marcar como lido ao rolar a página", + "general.privacy_data": "Privacidade & Dados", + "general.rebuild_database.button": "Reconstruir", + "general.rebuild_database.description": "Se estiver a ter problemas de renderização, reconstruir a base de dados pode resolver.", + "general.rebuild_database.label": "Reconstruir Base de Dados", + "general.rebuild_database.title": "Reconstruir Base de Dados", + "general.rebuild_database.warning.line1": "Reconstruir a base de dados vai apagar todos os seus dados locais.", + "general.rebuild_database.warning.line2": "Tem a certeza de que quer continuar?", + "general.send_anonymous_data.description": "Ao optar por enviar dados anónimos de telemetria, está a contribuir para a melhoria da experiência do utilizador no Follow.", + "general.send_anonymous_data.label": "Enviar dados anónimos", + "general.show_unread_on_launch.description": "Mostrar conteúdo não lido ao iniciar", + "general.show_unread_on_launch.label": "Mostrar conteúdo não lido ao iniciar", + "general.sidebar_title": "Geral", + "general.timeline": "Linha do tempo", + "general.unread": "Não lidos", + "general.voices": "Vozes", + "integration.eagle.enable.description": "Exibir o botão 'Guardar mídia no Eagle' quando disponível.", + "integration.eagle.enable.label": "Ativar", + "integration.eagle.title": "Eagle", + "integration.instapaper.enable.description": "Exibir o botão 'Guardar no Instapaper' quando disponível.", + "integration.instapaper.enable.label": "Ativar", + "integration.instapaper.password.label": "Palavra-passe do Instapaper", + "integration.instapaper.title": "Instapaper", + "integration.instapaper.username.label": "Nome de utilizador do Instapaper", + "integration.readwise.enable.description": "Exibir o botão 'Guardar no Readwise' quando disponível.", + "integration.readwise.enable.label": "Ativar", + "integration.readwise.title": "Readwise", + "integration.readwise.token.description": "Pode obtê-lo aqui: readwise.io/access_token.", + "integration.readwise.token.label": "Token de Acesso do Readwise", + "integration.sidebar_title": "Integração", + "integration.tip": "Dica: Os seus dados sensíveis são armazenados localmente e não são carregados para o servidor.", + "integration.title": "Integração", + "invitation.activate": "Ativar", + "invitation.codeOptions.betaUser": "1. Encontre um utilizador beta que o convide.", + "invitation.codeOptions.discord": "2. Junte-se ao nosso servidor Discord e receba presentes ocasionais.", + "invitation.codeOptions.xAccount": "3. Siga a nossa conta no X para receber presentes ocasionalmente.", + "invitation.confirmModal.cancel": "Cancelar", + "invitation.confirmModal.confirm": "Deseja continuar?", + "invitation.confirmModal.continue": "Continuar", + "invitation.confirmModal.message": "Gerar um código de convite vai custar-lhe {{INVITATION_PRICE}} Power.", + "invitation.confirmModal.title": "Confirmar", + "invitation.earlyAccess": "O Follow está atualmente em acesso antecipado e requer um código de convite para ser utilizado.", + "invitation.earlyAccessMessage": "😰 Desculpe, o Follow está atualmente em acesso antecipado e requer um código de convite para ser utilizado.", + "invitation.generateButton": "Gerar novo código", + "invitation.generateCost": "Pode gastar {{INVITATION_PRICE}} Power para gerar um código de convite para os seus amigos.", + "invitation.getCodeMessage": "Pode obter um código de convite através dos seguintes métodos:", + "invitation.newInvitationSuccess": "🎉 Novo convite gerado, o código de convite foi copiado", + "invitation.noInvitations": "Sem convites", + "invitation.notUsed": "Não utilizado", + "invitation.sidebar_title": "Convites", + "invitation.tableHeaders.code": "Código", + "invitation.tableHeaders.creationTime": "Hora de Criação", + "invitation.tableHeaders.usedBy": "Utilizado por", + "invitation.title": "Código de Convite", + "profile.avatar.label": "Avatar", + "profile.handle.description": "O seu identificador único.", + "profile.handle.label": "Identificador", + "profile.name.description": "O seu nome público visível.", + "profile.name.label": "Nome de Exibição", + "profile.sidebar_title": "Perfil", + "profile.submit": "Submeter", + "profile.title": "Configurações de Perfil", + "profile.updateSuccess": "Perfil atualizado.", + "titles.about": "Sobre", + "titles.actions": "Ações", + "titles.appearance": "Aparência", + "titles.general": "Geral", + "titles.integration": "Integração", + "titles.invitations": "Convites", + "titles.power": "Power", + "titles.profile": "Perfil", + "titles.shortcuts": "Atalhos", + "wallet.address.title": "O Seu Endereço", + "wallet.balance.title": "O Seu Saldo", + "wallet.balance.withdrawable": "Levantável", + "wallet.balance.withdrawableTooltip": "O Power levantável inclui tanto as dicas que recebeu quanto o Power que recarregou.", + "wallet.claim.button.claim": "Reivindicar Power Diário", + "wallet.claim.button.claimed": "Reivindicado hoje", + "wallet.claim.tooltip.alreadyClaimed": "Já reivindicou o seu Power hoje.", + "wallet.claim.tooltip.canClaim": "Reivindique agora o seu {{amount}} Power Diário!", + "wallet.create.button": "Criar Carteira", + "wallet.create.description": "Crie uma carteira gratuita para receber Power, que pode ser utilizado para recompensar criadores e também para ser recompensado pelas suas contribuições de conteúdo.", + "wallet.power.dailyClaim": "Pode reivindicar {{amount}} de Power gratuito diariamente, que pode ser usado para dar dicas em entradas de RSS no Follow.", + "wallet.power.description": "O Power é um token ERC-20 na blockchain {{blockchainName}}.", + "wallet.sidebar_title": "Power", + "wallet.transactions.amount": "Quantia", + "wallet.transactions.date": "Data", + "wallet.transactions.from": "De", + "wallet.transactions.noTransactions": "Sem transações", + "wallet.transactions.title": "Transações", + "wallet.transactions.to": "Para", + "wallet.transactions.tx": "Tx", + "wallet.transactions.type": "Tipo", + "wallet.transactions.types.burn": "queima", + "wallet.transactions.types.mint": "cunhagem", + "wallet.transactions.types.purchase": "compra", + "wallet.transactions.types.tip": "dica", + "wallet.transactions.types.withdraw": "levantamento", + "wallet.transactions.you": "Você", + "wallet.withdraw.addressLabel": "O seu endereço Ethereum", + "wallet.withdraw.amountLabel": "Quantia", + "wallet.withdraw.availableBalance": "Tem de Power levantável na sua carteira.", + "wallet.withdraw.button": "Levantar", + "wallet.withdraw.error": "O levantamento falhou: {{error}}", + "wallet.withdraw.modalTitle": "Levantar Power", + "wallet.withdraw.submitButton": "Submeter", + "wallet.withdraw.success": "Levantamento bem-sucedido!" +} diff --git a/locales/shortcuts/pt.json b/locales/shortcuts/pt.json new file mode 100644 index 000000000..85d13c60a --- /dev/null +++ b/locales/shortcuts/pt.json @@ -0,0 +1,24 @@ +{ + "keys.audio.playPause": "Reproduzir/Pausar (Quando o reprodutor de áudio estiver aberto)", + "keys.entries.markAllAsRead": "Marcar Tudo como Lido", + "keys.entries.next": "Próxima Entrada", + "keys.entries.previous": "Entrada Anterior", + "keys.entries.refetch": "Recarregar", + "keys.entries.toggleUnreadOnly": "Alternar Apenas Não Lidos", + "keys.entry.copyLink": "Copiar Link", + "keys.entry.openInBrowser": "Abrir no Navegador", + "keys.entry.openInNewTab": "Abrir numa Nova Aba", + "keys.entry.scrollDown": "Rolar para Baixo", + "keys.entry.scrollUp": "Rolar para Cima", + "keys.entry.share": "Partilhar", + "keys.entry.tip": "Dar Dica", + "keys.entry.toggleRead": "Alternar Leitura", + "keys.entry.toggleStarred": "Alternar Favorito", + "keys.entry.tts": "Reproduzir TTS", + "keys.feeds.add": "Adicionar Subscrição", + "keys.feeds.switchBetweenViews": "Alternar Entre Visualizações", + "keys.feeds.switchToView": "Mudar para Visualização", + "keys.layout.showShortcuts": "Mostrar/Ocultar Atalhos", + "keys.layout.toggleSidebar": "Mostrar/Ocultar Barra Lateral de Feed", + "sidebar_title": "Atalhos" +} diff --git a/src/renderer/src/@types/constants.ts b/src/renderer/src/@types/constants.ts index 666e864b3..98cc208ba 100644 --- a/src/renderer/src/@types/constants.ts +++ b/src/renderer/src/@types/constants.ts @@ -1,9 +1,10 @@ -const langs = ["en", "ja", "zh-CN"] +const langs = ["en", "ja", "zh-CN", "pt"] export const currentSupportedLanguages = langs.sort() export const dayjsLocaleImportMap = { en: ["en", () => import("dayjs/locale/en")], ["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")], ["ja"]: ["ja", () => import("dayjs/locale/ja")], + ["pt"]: ["pt", () => import("dayjs/locale/pt")], } export const ns = ["app", "common", "lang", "settings", "shortcuts"] as const export const defaultNS = "app" as const diff --git a/src/renderer/src/@types/default-resource.ts b/src/renderer/src/@types/default-resource.ts index 752f765b7..72c1ae03b 100644 --- a/src/renderer/src/@types/default-resource.ts +++ b/src/renderer/src/@types/default-resource.ts @@ -1,10 +1,12 @@ import en from "../../../../locales/app/en.json" import common_en from "../../../../locales/common/en.json" import common_ja from "../../../../locales/common/ja.json" +import common_pt from "../../../../locales/common/pt.json" import common_zhCN from "../../../../locales/common/zh-CN.json" import external_en from "../../../../locales/external/en.json" import lang_en from "../../../../locales/lang/en.json" import lang_ja from "../../../../locales/lang/ja.json" +import lang_pt from "../../../../locales/lang/pt.json" import lang_zhCN from "../../../../locales/lang/zh-CN.json" import settings_en from "../../../../locales/settings/en.json" import shortcuts_en from "../../../../locales/shortcuts/en.json" @@ -32,5 +34,6 @@ export const defaultResources = { lang: lang_ja, common: common_ja, }, + pt: { lang: lang_pt, common: common_pt }, ja: { lang: lang_ja, common: common_ja }, } From fea4fb1fe1f643fe41b4e898ab90ad8c1c6fb142 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 19:34:35 +0800 Subject: [PATCH 29/66] chore: remove duplicated i18n key Signed-off-by: Innei --- locales/app/en.json | 1 - locales/app/ja.json | 1 - locales/app/pt.json | 401 ++++++++++++++++++++--------------------- locales/app/zh-CN.json | 1 - 4 files changed, 200 insertions(+), 204 deletions(-) diff --git a/locales/app/en.json b/locales/app/en.json index 668d47a54..5fce7280c 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -2,7 +2,6 @@ "ai_daily.title": "Top News - {{title}}", "ai_daily.tooltip.content": "Here is news selected by AI from your timeline ( - ) that may be important to you.", "ai_daily.tooltip.update_schedule": "Update daily at 8 AM and 8 PM.", - "app.app_name": "APP_NAME", "app.copy_logo_svg": "Copy Logo SVG", "app.toggle_sidebar": "Toggle Sidebar", "discover.any_url_or_keyword": "Any URL or Keyword", diff --git a/locales/app/ja.json b/locales/app/ja.json index 6bf78d8fb..0ee5411c2 100644 --- a/locales/app/ja.json +++ b/locales/app/ja.json @@ -2,7 +2,6 @@ "ai_daily.title": "トップニュース - {{title}}", "ai_daily.tooltip.content": "こちらは、AIがあなたのタイムラインから選んだニュースです( - )。あなたにとって重要なニュースかもしれません。", "ai_daily.tooltip.update_schedule": "毎日午前8時と午後8時に更新されます。", - "app.app_name": "APP_NAME", "app.copy_logo_svg": "ロゴSVGをコピー", "app.toggle_sidebar": "サイドバーを切り替え", "discover.any_url_or_keyword": "任意のURLまたはキーワード", diff --git a/locales/app/pt.json b/locales/app/pt.json index 3b911ea37..191a45783 100644 --- a/locales/app/pt.json +++ b/locales/app/pt.json @@ -1,207 +1,206 @@ { - "ai_daily.title": "Principais Notícias - {{title}}", - "ai_daily.tooltip.content": "Aqui estão as notícias selecionadas pela IA da sua linha do tempo ( - ), que podem ser importantes para si.", - "ai_daily.tooltip.update_schedule": "Atualizações diárias às 8h00 e às 20h00.", - "app.app_name": "NOME_APP", - "app.copy_logo_svg": "Copiar Logo SVG", - "app.toggle_sidebar": "Alternar Barra Lateral", - "discover.any_url_or_keyword": "Qualquer URL ou Palavra-chave", - "discover.default_option": " (padrão)", - "discover.feed_description": "A descrição deste feed é a seguinte, e pode preencher o formulário de parâmetros com as informações relevantes.", - "discover.feed_maintainers": "Este feed é fornecido por RSSHub, com créditos para ", - "discover.import.click_to_upload": "Clique para carregar o ficheiro OPML", - "discover.popular": "Popular", - "discover.preview": "Pré-visualizar", - "discover.rss_hub_route": "Rota RSSHub", - "discover.rss_url": "URL do RSS", - "discover.select_placeholder": "Selecionar", - "early_access": "Acesso Antecipado", - "entry_actions.copy_link": "Copiar link", - "entry_actions.failed_to_save_to_eagle": "Falha ao guardar no Eagle.", - "entry_actions.failed_to_save_to_instapaper": "Falha ao guardar no Instapaper.", - "entry_actions.failed_to_save_to_readwise": "Falha ao guardar no Readwise.", - "entry_actions.link_copied": "Link copiado para a área de transferência.", - "entry_actions.mark_as_read": "Marcar como lido", - "entry_actions.mark_as_unread": "Marcar como não lido", - "entry_actions.open_in_browser": "Abrir no navegador", - "entry_actions.save_media_to_eagle": "Guardar mídia no Eagle", - "entry_actions.save_to_instapaper": "Guardar no Instapaper", - "entry_actions.save_to_readwise": "Guardar no Readwise", - "entry_actions.saved_to_eagle": "Guardado no Eagle.", - "entry_actions.saved_to_instapaper": "Guardado no Instapaper.", - "entry_actions.saved_to_readwise": "Guardado no Readwise.", - "entry_actions.share": "Partilhar", - "entry_actions.star": "Favorito", - "entry_actions.starred": "Favoritado.", - "entry_actions.tip": "Dica", - "entry_actions.unstar": "Remover favorito", - "entry_actions.unstarred": "Favorito removido.", - "entry_column.refreshing": "A atualizar entradas...", - "entry_content.ai_summary": "Resumo IA", - "entry_content.fetching_content": "A obter conteúdo original e a processar...", - "entry_content.header.play_tts": "Reproduzir TTS", - "entry_content.header.readability": "Legibilidade", - "entry_content.no_content": "Sem conteúdo", - "entry_content.readability_notice": "Este conteúdo é fornecido pela Readability. Se encontrar erros tipográficos, consulte o site de origem para ver o conteúdo original.", - "entry_content.render_error": "Erro ao renderizar:", - "entry_content.report_issue": "Relatar problema", - "entry_content.web_app_notice": "Talvez a aplicação web não suporte este tipo de conteúdo. Pode fazer o download da aplicação para desktop.", - "entry_list.zero_unread": "Sem não lidos", - "entry_list_header.daily_report": "Relatório Diário", - "entry_list_header.hide_no_image_items": "Ocultar entradas sem imagens", - "entry_list_header.items": "itens", - "entry_list_header.new_entries_available": "Novas entradas disponíveis", - "entry_list_header.refetch": "Recarregar", - "entry_list_header.refresh": "Atualizar", - "entry_list_header.show_all": "Mostrar tudo", - "entry_list_header.show_all_items": "Mostrar todas as entradas", - "entry_list_header.show_unread_only": "Mostrar apenas não lidos", - "entry_list_header.switch_to_grid": "Mudar para grelha", - "entry_list_header.switch_to_masonry": "Mudar para layout de alvenaria", - "entry_list_header.unread": "não lidos", - "feed_claim_modal.choose_verification_method": "Existem três métodos de verificação. Pode escolher um para confirmar.", - "feed_claim_modal.claim_button": "Reivindicar", - "feed_claim_modal.content_instructions": "Copie o conteúdo abaixo e publique-o no seu feed RSS mais recente.", - "feed_claim_modal.description_current": "Descrição atual:", - "feed_claim_modal.description_instructions": "Copie o seguinte conteúdo e cole-o no campo do seu feed RSS.", - "feed_claim_modal.failed_to_load": "Falha ao carregar a mensagem de reivindicação", - "feed_claim_modal.rss_format_choice": "Os geradores de RSS geralmente têm dois formatos. Por favor, copie os formatos XML e JSON conforme necessário.", - "feed_claim_modal.rss_instructions": "Copie o código abaixo e cole-o no seu gerador de RSS.", - "feed_claim_modal.rss_json_format": "Formato JSON", - "feed_claim_modal.rss_xml_format": "Formato XML", - "feed_claim_modal.rsshub_notice": "Este feed é fornecido pelo RSSHub com um tempo de cache de 1 hora. Por favor, aguarde até 1 hora para que as alterações apareçam após a publicação do conteúdo.", - "feed_claim_modal.tab_content": "Conteúdo", - "feed_claim_modal.tab_description": "Descrição", - "feed_claim_modal.tab_rss": "Tag RSS", - "feed_claim_modal.verify_ownership": "Para reivindicar este feed como seu, precisa de verificar a propriedade.", - "feed_form.add_follow": "Adicionar seguir", - "feed_form.category": "Categoria", - "feed_form.category_description": "Por padrão, os seus feeds seguidos serão agrupados por site.", - "feed_form.error_fetching_feed": "Erro ao obter o feed.", - "feed_form.feed_not_found": "Feed não encontrado.", - "feed_form.feedback": "Comentários", - "feed_form.follow": "Seguir", - "feed_form.followed": "🎉 Seguido.", - "feed_form.private_follow": "Seguir em privado", - "feed_form.private_follow_description": "Se este seguimento será ou não visível publicamente no seu perfil.", - "feed_form.retry": "Tentar novamente", - "feed_form.title": "Título", - "feed_form.title_description": "Título personalizado para este feed. Deixe em branco para usar o padrão.", - "feed_form.unfollow": "Deixar de seguir", - "feed_form.update": "Atualizar", - "feed_form.update_follow": "Atualizar seguir", - "feed_form.updated": "🎉 Atualizado.", - "feed_form.view": "Ver", - "feed_item.claimed_by_owner": "Este feed foi reivindicado por", - "feed_item.claimed_by_unknown": "o proprietário.", - "feed_item.claimed_by_you": "Reivindicado por si", - "feed_item.claimed_feed": "Feed reivindicado", - "feed_item.error_since": "Erro desde", - "feed_item.not_publicly_visible": "Não visível publicamente no seu perfil", - "feed_view_type.articles": "Artigos", - "feed_view_type.audios": "Áudios", - "feed_view_type.notifications": "Notificações", - "feed_view_type.pictures": "Imagens", - "feed_view_type.social_media": "Redes Sociais", - "feed_view_type.videos": "Vídeos", - "mark_all_read_button.auto_confirm_info": "Será confirmado automaticamente após 3 segundos.", - "mark_all_read_button.confirm": "Confirmar", - "mark_all_read_button.confirm_mark_all": "Marcar {{which}} como lido?", - "mark_all_read_button.confirm_mark_all_info": "Confirmar marcar tudo como lido?", - "mark_all_read_button.mark_all_as_read": "Marcar tudo como lido", - "mark_all_read_button.mark_as_read": "Marcar {{which}} como lido", - "mark_all_read_button.undo": "Desfazer", - "player.back_10s": "Voltar 10s", - "player.close": "Fechar", - "player.download": "Download", - "player.exit_full_screen": "Sair de ecrã completo", - "player.forward_10s": "Avançar 10s", - "player.full_screen": "Ecrã completo", - "player.mute": "Silenciar", - "player.open_entry": "Abrir entrada", - "player.pause": "Pausar", - "player.play": "Reproduzir", - "player.playback_rate": "Velocidade de reprodução", - "player.unmute": "Ativar som", - "player.volume": "Volume", - "search.empty.no_results": "Nenhum resultado encontrado.", - "search.group.entries": "Entradas", - "search.group.feeds": "Feeds", - "search.options.all": "Todos", - "search.options.entries": "Entradas", - "search.options.feeds": "Feeds", - "search.options.search_type": "Tipo de pesquisa", - "search.placeholder": "Pesquisar...", - "search.result_count_local_mode": "(Modo local)", - "search.tooltip.local_search": "Esta pesquisa abrange os dados disponíveis localmente. Tente recarregar para incluir os dados mais recentes.", - "shortcuts.guide.title": "Guia de Atalhos", - "sidebar.category_remove_dialog.cancel": "Cancelar", - "sidebar.category_remove_dialog.continue": "Continuar", - "sidebar.category_remove_dialog.description": "Esta operação vai apagar a sua categoria, mas os feeds que ela contém serão mantidos e agrupados por site.", - "sidebar.category_remove_dialog.title": "Remover Categoria", - "sidebar.feed_actions.claim": "Reivindicar", - "sidebar.feed_actions.claim_feed": "Reivindicar Feed", - "sidebar.feed_actions.copy_feed_id": "Copiar ID do feed", - "sidebar.feed_actions.copy_feed_url": "Copiar URL do feed", - "sidebar.feed_actions.edit": "Editar", - "sidebar.feed_actions.edit_feed": "Editar feed", - "sidebar.feed_actions.feed_owned_by_you": "Este feed pertence a si", - "sidebar.feed_actions.mark_all_as_read": "Marcar tudo como lido", - "sidebar.feed_actions.navigate_to_feed": "Navegar para o feed", - "sidebar.feed_actions.open_feed_in_browser": "Abrir feed no navegador", - "sidebar.feed_actions.open_site_in_browser": "Abrir site no navegador", - "sidebar.feed_actions.unfollow": "Deixar de seguir", - "sidebar.feed_actions.unfollow_feed": "Deixar de seguir feed", - "sidebar.feed_column.context_menu.change_to_other_view": "Mudar para outro modo de visualização", - "sidebar.feed_column.context_menu.delete_category": "Apagar categoria", - "sidebar.feed_column.context_menu.delete_category_confirmation": "Apagar categoria {{folderName}}?", - "sidebar.feed_column.context_menu.mark_as_read": "Marcar como lido", - "sidebar.feed_column.context_menu.rename_category": "Renomear categoria", - "sidebar.select_sort_method": "Selecionar método de ordenação", - "signin.continue_with_github": "Continuar com o GitHub", - "signin.continue_with_google": "Continuar com o Google", - "signin.sign_in_to": "Iniciar sessão em", - "sync_indicator.disabled": "Por motivos de segurança, a sincronização está desativada.", - "sync_indicator.offline": "Offline", - "sync_indicator.synced": "Sincronizado com o servidor", - "tip_modal.amount": "Quantia", - "tip_modal.claim_feed": "Reivindicar este feed", - "tip_modal.create_wallet": "Criar Grátis", - "tip_modal.feed_owner": "Proprietário do Feed", - "tip_modal.low_balance": "O seu saldo não é suficiente para cobrir esta dica. Por favor, ajuste a quantia.", - "tip_modal.no_wallet": "Ainda não tem uma carteira. Por favor, crie uma carteira para enviar dicas.", - "tip_modal.tip_amount_sent": "foi enviado ao autor.", - "tip_modal.tip_now": "Enviar Dica Agora", - "tip_modal.tip_sent": "Dica enviada com sucesso! Obrigado pelo seu apoio.", - "tip_modal.tip_support": "⭐ Envie uma dica para mostrar o seu apoio!", - "tip_modal.unclaimed_feed": "Ninguém reivindicou este feed ainda. O Power recebido será mantido em segurança no contrato blockchain até ser reivindicado.", - "user_button.account": "Conta", - "user_button.download_desktop_app": "Descarregar aplicação para desktop", - "user_button.log_out": "Terminar sessão", + "ai_daily.title": "トップニュース - {{title}}", + "ai_daily.tooltip.content": "こちらは、AI があなたのタイムラインから選んだニュースです( - )。あなたにとって重要なニュースかもしれません。", + "ai_daily.tooltip.update_schedule": "毎日午前 8 時と午後 8 時に更新されます。", + "app.copy_logo_svg": "ロゴ SVG をコピー", + "app.toggle_sidebar": "サイドバーを切り替え", + "discover.any_url_or_keyword": "任意の URL またはキーワード", + "discover.default_option": " (デフォルト)", + "discover.feed_description": "このフィードの説明は以下の通りです。必要な情報をパラメータフォームに入力してください。", + "discover.feed_maintainers": "このフィードは RSSHub が提供しています。に感謝します。", + "discover.import.click_to_upload": "OPML ファイルをアップロードするにはクリック", + "discover.popular": "人気", + "discover.preview": "プレビュー", + "discover.rss_hub_route": "RSSHub ルート", + "discover.rss_url": "RSS URL", + "discover.select_placeholder": "選択", + "early_access": "アーリーアクセス", + "entry_actions.copy_link": "リンクをコピー", + "entry_actions.failed_to_save_to_eagle": "Eagle への保存に失敗しました。", + "entry_actions.failed_to_save_to_instapaper": "Instapaper への保存に失敗しました。", + "entry_actions.failed_to_save_to_readwise": "Readwise への保存に失敗しました。", + "entry_actions.link_copied": "リンクがクリップボードにコピーされました。", + "entry_actions.mark_as_read": "既読にする", + "entry_actions.mark_as_unread": "未読にする", + "entry_actions.open_in_browser": "ブラウザで開く", + "entry_actions.save_media_to_eagle": "メディアを Eagle に保存", + "entry_actions.save_to_instapaper": "Instapaper に保存", + "entry_actions.save_to_readwise": "Readwise に保存", + "entry_actions.saved_to_eagle": "Eagle に保存されました。", + "entry_actions.saved_to_instapaper": "Instapaper に保存されました。", + "entry_actions.saved_to_readwise": "Readwise に保存されました。", + "entry_actions.share": "共有", + "entry_actions.star": "スター", + "entry_actions.starred": "スターに登録されました。", + "entry_actions.tip": "チップ", + "entry_actions.unstar": "スターを解除", + "entry_actions.unstarred": "スターが解除されました。", + "entry_column.refreshing": "新しいエントリを更新中...", + "entry_content.ai_summary": "AI による要約", + "entry_content.fetching_content": "元のコンテンツを取得し、処理中です...", + "entry_content.header.play_tts": "TTS を再生", + "entry_content.header.readability": "読みやすさ", + "entry_content.no_content": "コンテンツがありません", + "entry_content.readability_notice": "このコンテンツは Readability により提供されています。誤字などを発見した場合は、元のサイトでオリジナルのコンテンツをご覧ください。", + "entry_content.render_error": "レンダリングエラー:", + "entry_content.report_issue": "問題を報告", + "entry_content.web_app_notice": "このコンテンツタイプはウェブアプリではサポートされていないかもしれません。デスクトップアプリをダウンロードしてください。", + "entry_list.zero_unread": "未読ゼロ", + "entry_list_header.daily_report": "日報", + "entry_list_header.hide_no_image_items": "画像がないエントリを非表示", + "entry_list_header.items": "項目", + "entry_list_header.new_entries_available": "新しいエントリが利用可能です", + "entry_list_header.refetch": "再取得", + "entry_list_header.refresh": "更新", + "entry_list_header.show_all": "すべて表示", + "entry_list_header.show_all_items": "すべてのエントリを表示", + "entry_list_header.show_unread_only": "未読のみ表示", + "entry_list_header.switch_to_grid": "グリッドに切り替え", + "entry_list_header.switch_to_masonry": "メイソンリーレイアウトに切り替え", + "entry_list_header.unread": "未読", + "feed_claim_modal.choose_verification_method": "選択肢は 3 つあります。そのうち 1 つを選んで確認してください。", + "feed_claim_modal.claim_button": "クレーム", + "feed_claim_modal.content_instructions": "以下の内容をコピーして、最新の RSS フィードに投稿してください。", + "feed_claim_modal.description_current": "現在の説明:", + "feed_claim_modal.description_instructions": "次の内容をコピーし、RSS フィードのフィールドに貼り付けてください。", + "feed_claim_modal.failed_to_load": "クレームメッセージの読み込みに失敗しました", + "feed_claim_modal.rss_format_choice": "RSS ジェネレータには通常 2 つのフォーマットがあります。必要に応じて以下の XML および JSON フォーマットをコピーしてください。", + "feed_claim_modal.rss_instructions": "以下のコードをコピーし、RSS ジェネレータに貼り付けてください。", + "feed_claim_modal.rss_json_format": "JSON フォーマット", + "feed_claim_modal.rss_xml_format": "XML フォーマット", + "feed_claim_modal.rsshub_notice": "このフィードは RSSHub によって提供されており、キャッシュ時間は 1 時間です。コンテンツの変更が反映されるまで最大 1 時間かかる場合があります。", + "feed_claim_modal.tab_content": "コンテンツ", + "feed_claim_modal.tab_description": "説明", + "feed_claim_modal.tab_rss": "RSS タグ", + "feed_claim_modal.verify_ownership": "このフィードを自分のものとしてクレームするには、所有権を確認する必要があります。", + "feed_form.add_follow": "フォローを追加", + "feed_form.category": "カテゴリー", + "feed_form.category_description": "デフォルトでは、フォローはウェブサイトごとにグループ化されます。", + "feed_form.error_fetching_feed": "フィードの取得に失敗しました。", + "feed_form.feed_not_found": "フィードが見つかりません。", + "feed_form.feedback": "フィードバック", + "feed_form.follow": "フォロー", + "feed_form.followed": "🎉 フォローしました。", + "feed_form.private_follow": "プライベートフォロー", + "feed_form.private_follow_description": "このフォローがあなたのプロフィールページに公開されるかどうか。", + "feed_form.retry": "再試行", + "feed_form.title": "タイトル", + "feed_form.title_description": "このフィードのカスタムタイトル。デフォルトを使用するには空白のままにしてください。", + "feed_form.unfollow": "フォロー解除", + "feed_form.update": "更新", + "feed_form.update_follow": "フォローを更新", + "feed_form.updated": "🎉 更新されました。", + "feed_form.view": "表示", + "feed_item.claimed_by_owner": "このフィードは", + "feed_item.claimed_by_unknown": "その所有者によってクレームされています。", + "feed_item.claimed_by_you": "あなたによってクレームされています", + "feed_item.claimed_feed": "クレームされたフィード", + "feed_item.error_since": "エラー発生時刻", + "feed_item.not_publicly_visible": "プロフィールページに公開されていません", + "feed_view_type.articles": "記事", + "feed_view_type.audios": "オーディオ", + "feed_view_type.notifications": "通知", + "feed_view_type.pictures": "画像", + "feed_view_type.social_media": "ソーシャルメディア", + "feed_view_type.videos": "動画", + "mark_all_read_button.auto_confirm_info": "3 秒後に自動的に確認されます。", + "mark_all_read_button.confirm": "確認", + "mark_all_read_button.confirm_mark_all": "{{which}}を既読にしますか?", + "mark_all_read_button.confirm_mark_all_info": "すべてを既読にしますか?", + "mark_all_read_button.mark_all_as_read": "すべてを既読にする", + "mark_all_read_button.mark_as_read": "{{which}}を既読にする", + "mark_all_read_button.undo": "元に戻す", + "player.back_10s": "10 秒戻る", + "player.close": "閉じる", + "player.download": "ダウンロード", + "player.exit_full_screen": "フルスクリーンを終了", + "player.forward_10s": "10 秒進む", + "player.full_screen": "フルスクリーン", + "player.mute": "ミュート", + "player.open_entry": "エントリを開く", + "player.pause": "一時停止", + "player.play": "再生", + "player.playback_rate": "再生速度", + "player.unmute": "ミュート解除", + "player.volume": "音量", + "search.empty.no_results": "結果が見つかりませんでした。", + "search.group.entries": "エントリ", + "search.group.feeds": "フィード", + "search.options.all": "すべて", + "search.options.entries": "エントリ", + "search.options.feeds": "フィード", + "search.options.search_type": "検索タイプ", + "search.placeholder": "検索...", + "search.result_count_local_mode": "(ローカルモード)", + "search.tooltip.local_search": "この検索は、ローカルで利用可能なデータを対象としています。最新データを含めるために再取得を試してください。", + "shortcuts.guide.title": "ショートカットガイドライン", + "sidebar.category_remove_dialog.cancel": "キャンセル", + "sidebar.category_remove_dialog.continue": "続行", + "sidebar.category_remove_dialog.description": "この操作によりカテゴリーが削除されますが、含まれているフィードは保持され、ウェブサイトごとにグループ化されます。", + "sidebar.category_remove_dialog.title": "カテゴリーを削除", + "sidebar.feed_actions.claim": "クレーム", + "sidebar.feed_actions.claim_feed": "フィードをクレーム", + "sidebar.feed_actions.copy_feed_id": "フィード ID をコピー", + "sidebar.feed_actions.copy_feed_url": "フィード URL をコピー", + "sidebar.feed_actions.edit": "編集", + "sidebar.feed_actions.edit_feed": "フィードを編集", + "sidebar.feed_actions.feed_owned_by_you": "このフィードはあなたが所有しています", + "sidebar.feed_actions.mark_all_as_read": "すべてを既読にする", + "sidebar.feed_actions.navigate_to_feed": "フィードに移動", + "sidebar.feed_actions.open_feed_in_browser": "ブラウザでフィードを開く", + "sidebar.feed_actions.open_site_in_browser": "ブラウザでサイトを開く", + "sidebar.feed_actions.unfollow": "フォロー解除", + "sidebar.feed_actions.unfollow_feed": "フィードのフォローを解除", + "sidebar.feed_column.context_menu.change_to_other_view": "他のビューに切り替え", + "sidebar.feed_column.context_menu.delete_category": "カテゴリーを削除", + "sidebar.feed_column.context_menu.delete_category_confirmation": "カテゴリー{{folderName}}を削除しますか?", + "sidebar.feed_column.context_menu.mark_as_read": "既読にする", + "sidebar.feed_column.context_menu.rename_category": "カテゴリーの名前を変更", + "sidebar.select_sort_method": "並べ替え方法を選択", + "signin.continue_with_github": "GitHub で続ける", + "signin.continue_with_google": "Google で続ける", + "signin.sign_in_to": "サインイン", + "sync_indicator.disabled": "セキュリティ上の理由により、同期は無効になっています。", + "sync_indicator.offline": "オフライン", + "sync_indicator.synced": "サーバーと同期済み", + "tip_modal.amount": "金額", + "tip_modal.claim_feed": "このフィードをクレーム", + "tip_modal.create_wallet": "無料で作成", + "tip_modal.feed_owner": "フィードの所有者", + "tip_modal.low_balance": "このチップをカバーするには残高が不足しています。金額を調整してください。", + "tip_modal.no_wallet": "まだウォレットがありません。ウォレットを作成してチップを送信してください。", + "tip_modal.tip_amount_sent": "が作者に送信されました。", + "tip_modal.tip_now": "今すぐチップ", + "tip_modal.tip_sent": "チップが正常に送信されました!ご支援ありがとうございます。", + "tip_modal.tip_support": "⭐ サポートを示すためにチップを送る!", + "tip_modal.unclaimed_feed": "このフィードはまだ誰にもクレームされていません。受け取った Power は、フィードがクレームされるまでブロックチェーン契約で安全に保持されます。", + "user_button.account": "アカウント", + "user_button.download_desktop_app": "デスクトップアプリをダウンロード", + "user_button.log_out": "ログアウト", "user_button.power": "Power", - "user_button.preferences": "Preferências", - "user_button.profile": "Perfil", - "user_profile.close": "Fechar", - "user_profile.edit": "Editar", - "user_profile.loading": "A carregar", - "user_profile.share": "Partilhar", - "user_profile.toggle_item_style": "Alternar Estilo de Item", - "words.add": "Adicionar", - "words.confirm": "Confirmar", - "words.discover": "Descobrir", - "words.email": "E-mail", - "words.import": "Importar", - "words.items": "Itens", - "words.language": "Idioma", - "words.load_archived_entries": "Carregar entradas arquivadas", - "words.login": "Iniciar sessão", + "user_button.preferences": "設定", + "user_button.profile": "プロフィール", + "user_profile.close": "閉じる", + "user_profile.edit": "編集", + "user_profile.loading": "読み込み中", + "user_profile.share": "共有", + "user_profile.toggle_item_style": "アイテムスタイルを切り替え", + "words.add": "追加", + "words.confirm": "確認", + "words.discover": "発見", + "words.email": "メール", + "words.import": "インポート", + "words.items": "アイテム", + "words.language": "言語", + "words.load_archived_entries": "アーカイブされたエントリを読み込む", + "words.login": "ログイン", "words.rss": "RSS", "words.rss3": "RSS3", "words.rsshub": "RSSHub", - "words.search": "Pesquisar", - "words.starred": "Favoritos", - "words.unread": "Não lidos", - "words.user": "Utilizador", - "words.which.all": "todos", - "words.zero_items": "Sem itens" + "words.search": "検索", + "words.starred": "スター付き", + "words.unread": "未読", + "words.user": "ユーザー", + "words.which.all": "すべて", + "words.zero_items": "アイテムがありません" } diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 3634579ee..62d8aa1f7 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -2,7 +2,6 @@ "ai_daily.title": "头条 - {{title}}", "ai_daily.tooltip.content": "这里是通过 AI 从您的时间线中选择的头条新闻( - ),可能对您很重要。", "ai_daily.tooltip.update_schedule": "每天早上 8 点、晚上 8 点更新。", - "app.app_name": "APP_NAME", "app.copy_logo_svg": "复制 Logo SVG", "app.toggle_sidebar": "切换侧边栏", "discover.any_url_or_keyword": "任何 URL 或关键词", From 49a5c50236d51c3c728bb51cd19f34915291e59a Mon Sep 17 00:00:00 2001 From: Pionxzh Date: Sat, 14 Sep 2024 19:35:48 +0800 Subject: [PATCH 30/66] feat(i18n): add zh-CN i18n for external page (#399) * feat(i18n): add `zh-CN` i18n for external page * fix(i18n): fix external zh-CN translation * fix(i18n): fix external zh-CN translation --- locales/external/zh-CN.json | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 locales/external/zh-CN.json diff --git a/locales/external/zh-CN.json b/locales/external/zh-CN.json new file mode 100644 index 000000000..8a2c6030f --- /dev/null +++ b/locales/external/zh-CN.json @@ -0,0 +1,42 @@ +{ + "feed": { + "follow_one": "关注者", + "follow_other": "关注者", + "followsAndReads": "在 {{appName}} 上有 {{subscriptionCount}} 个{{subscriptionNoun}},{{readCount}} 篇{{readNoun}}", + "read_one": "文章", + "read_other": "文章" + }, + "header": { + "app": "应用", + "download": "下载" + }, + "invitation": { + "activate": "激活", + "codeOptions": { + "1": "寻找任何内测用户来邀请你。", + "2": "加入我们的 Discord 服务器,获取不定期的赠送机会。", + "3": "关注我们的 X 账号,获取不定期的赠送机会。" + }, + "earlyAccess": "Follow 目前处于早期访问阶段,需要邀请码才能使用。", + "earlyAccessMessage": "😰 抱歉,Follow 目前处于早期访问阶段,需要邀请码才能使用。", + "generateButton": "生成新邀请码", + "generateCost": "你可以花费 {{INVITATION_PRICE}} Power 生成一个邀请码给你的朋友。", + "getCodeMessage": "你可以通过以下方式获取邀请码:", + "title": "邀请码" + }, + "login": { + "backToWebApp": "返回网页版", + "continueWithGitHub": "通过 GitHub 继续", + "continueWithGoogle": "通过 Google 继续", + "logInTo": "登录到 ", + "openApp": "打开应用", + "redirecting": "重定向中", + "welcomeTo": "欢迎来到 " + }, + "redirect": { + "continueInBrowser": "在浏览器中继续", + "instruction": "现在可以打开 {{APP_NAME}} 并安心地关闭此页面。", + "openApp": "打开 {{APP_NAME}}", + "successMessage": "你已成功连接到 {{APP_NAME}} 账户。" + } +} From d90964ea9e32d5d7b162d6d7525df213ac732e12 Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 14 Sep 2024 21:06:07 +0800 Subject: [PATCH 31/66] fix(i18n): dup key Signed-off-by: Innei --- src/renderer/src/@types/default-resource.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/src/@types/default-resource.ts b/src/renderer/src/@types/default-resource.ts index 72c1ae03b..d07238da7 100644 --- a/src/renderer/src/@types/default-resource.ts +++ b/src/renderer/src/@types/default-resource.ts @@ -35,5 +35,4 @@ export const defaultResources = { common: common_ja, }, pt: { lang: lang_pt, common: common_pt }, - ja: { lang: lang_ja, common: common_ja }, } From c3675b25886ddd33f232f0c146208cb8f42c0b36 Mon Sep 17 00:00:00 2001 From: CHANX Date: Sat, 14 Sep 2024 23:17:29 +0800 Subject: [PATCH 32/66] fix: read history always show (#413) --- .../src/modules/entry-content/components/EntryReadHistory.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx index af0d7e497..ccda95609 100644 --- a/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx +++ b/src/renderer/src/modules/entry-content/components/EntryReadHistory.tsx @@ -61,7 +61,7 @@ export const EntryReadHistory: Component<{ entryId: string }> = ({ entryId }) => entryHistory.readCount > 10 && entryHistory.userIds && entryHistory.userIds.length >= 10 && ( - +
    From fa37a0ca2c8235fb5fd47f96c26de7fdcd762ad8 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 15 Sep 2024 02:29:19 +0800 Subject: [PATCH 35/66] feat: invitation limitation message --- locales/settings/en.json | 1 + src/hono.ts | 39 +++++++++++-------- .../src/modules/settings/tabs/invitations.tsx | 14 ++++++- src/renderer/src/queries/invitations.ts | 6 +++ 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/locales/settings/en.json b/locales/settings/en.json index afb4d62eb..5a14d56c1 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -131,6 +131,7 @@ "invitation.generateButton": "Generate new code", "invitation.generateCost": "You can spend {{INVITATION_PRICE}} Power to generate an invitation code for your friends.", "invitation.getCodeMessage": "You can get an invitation code through the following methods:", + "invitation.limitationMessage": "Based on your usage time, you can generate up to {{limitation}} invitation codes.", "invitation.newInvitationSuccess": "🎉 New invitation generated, invite code is copied", "invitation.noInvitations": "No invitations", "invitation.notUsed": "Not used", diff --git a/src/hono.ts b/src/hono.ts index bb2b2db91..02bc36547 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -3492,21 +3492,23 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ dialect: "pg" }> declare const usersOpenApiSchema: z.ZodObject< - { - id: z.ZodString - name: z.ZodNullable - email: z.ZodString - emailVerified: z.ZodNullable - image: z.ZodNullable - handle: z.ZodNullable - createdAt: z.ZodDate - }, + Omit< + { + id: z.ZodString + name: z.ZodNullable + email: z.ZodString + emailVerified: z.ZodNullable + image: z.ZodNullable + handle: z.ZodNullable + createdAt: z.ZodDate + }, + "email" + >, z.UnknownKeysParam, z.ZodTypeAny, { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -3515,7 +3517,6 @@ declare const usersOpenApiSchema: z.ZodObject< { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -4416,7 +4417,6 @@ declare const _routes: hono_hono_base.HonoBase< fromUser: { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -4425,7 +4425,6 @@ declare const _routes: hono_hono_base.HonoBase< toUser: { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -4619,7 +4618,6 @@ declare const _routes: hono_hono_base.HonoBase< owner: { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -4819,7 +4817,6 @@ declare const _routes: hono_hono_base.HonoBase< data: { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null @@ -4900,6 +4897,17 @@ declare const _routes: hono_hono_base.HonoBase< status: 200 } } + "/invitations/limitation": { + $get: { + input: {} + output: { + code: 0 + data: number + } + outputFormat: "json" | "text" + status: 200 + } + } } & { "/feeds/claim/message": { $get: { @@ -5300,7 +5308,6 @@ declare const _routes: hono_hono_base.HonoBase< owner: { name: string | null id: string - email: string emailVerified: string | null image: string | null handle: string | null diff --git a/src/renderer/src/modules/settings/tabs/invitations.tsx b/src/renderer/src/modules/settings/tabs/invitations.tsx index 074cb0a6b..84ab6c065 100644 --- a/src/renderer/src/modules/settings/tabs/invitations.tsx +++ b/src/renderer/src/modules/settings/tabs/invitations.tsx @@ -33,6 +33,7 @@ import { toast } from "sonner" export const SettingInvitations = () => { const { t } = useTranslation("settings") const invitations = useAuthQuery(Queries.invitations.list()) + const limitation = useAuthQuery(Queries.invitations.limitation()) const { present } = useModalStack() const presentUserProfile = usePresentUserProfileModal("drawer") @@ -54,7 +55,16 @@ export const SettingInvitations = () => { PowerIcon: , }} i18nKey="invitation.generateCost" - /> + /> +

    +

    +

    @@ -173,7 +173,7 @@ const ConfirmModalContent = ({ dismiss }: { dismiss: () => void }) => { return ( <> -
    +
    void }) => { i18nKey="invitation.confirmModal.message" />
    -
    {t("invitation.confirmModal.confirm")}
    +
    {t("invitation.confirmModal.confirm")}
    + + + + {t("feeds.tableHeaders.name")} + + + {t("feeds.tableHeaders.entryCount")} + + + {t("feeds.tableHeaders.subscriptionCount")} + + + {t("feeds.tableHeaders.tipAmount")} + + + + + {claimedList.data?.map((row) => ( + + + + + + {row.feed.title} + + + + + {row.entryCount} + + + {row.subscriptionCount} + + + {BigInt(row.tipAmount || 0n)} + + + ))} + +
    + ) : claimedList.isLoading ? ( + + ) : ( +
    +

    {t("feeds.noFeeds")}

    +
    + )} +
    +
    +
    + ) +} diff --git a/src/renderer/src/pages/settings/(settings)/feeds.tsx b/src/renderer/src/pages/settings/(settings)/feeds.tsx new file mode 100644 index 000000000..a7f3e2517 --- /dev/null +++ b/src/renderer/src/pages/settings/(settings)/feeds.tsx @@ -0,0 +1,21 @@ +import { SettingFeeds } from "@renderer/modules/settings/tabs/feeds" +import { SettingsTitle } from "@renderer/modules/settings/title" +import { defineSettingPageData } from "@renderer/modules/settings/utils" + +const iconName = "i-mgc-certificate-cute-re" +const priority = 1053 + +export const loader = defineSettingPageData({ + iconName, + name: "titles.feeds", + priority, +}) + +export function Component() { + return ( + <> + + + + ) +} diff --git a/src/renderer/src/queries/feed.ts b/src/renderer/src/queries/feed.ts index 358eba1fd..aa34ae88d 100644 --- a/src/renderer/src/queries/feed.ts +++ b/src/renderer/src/queries/feed.ts @@ -32,6 +32,11 @@ export const feed = { return res }), ), + claimedList: () => + defineQuery(["feed", "claimedList"], async () => { + const res = await apiClient.feeds.claim.list.$get() + return res.data + }), } export const useFeed = ({ id, url }: FeedQueryParams) => From 38c21dae11b84d1cb493078f999c7dac9b72d348 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 15 Sep 2024 20:53:00 +0800 Subject: [PATCH 47/66] feat: add show all when filtered media mode Signed-off-by: Innei --- icons/mgc/photo_album_cute_fi.svg | 1 + locales/app/en.json | 4 +- .../entry-column/Items/picture-item.tsx | 6 +- .../src/modules/entry-column/index.tsx | 70 +++++++++++++++---- .../entry-column/layouts/EntryListHeader.tsx | 2 +- .../src/modules/settings/tabs/invitations.tsx | 4 +- 6 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 icons/mgc/photo_album_cute_fi.svg diff --git a/icons/mgc/photo_album_cute_fi.svg b/icons/mgc/photo_album_cute_fi.svg new file mode 100644 index 000000000..a96ad87de --- /dev/null +++ b/icons/mgc/photo_album_cute_fi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/locales/app/en.json b/locales/app/en.json index 5fce7280c..6498ff6d6 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -35,12 +35,14 @@ "entry_actions.tip": "Tip", "entry_actions.unstar": "Unstar", "entry_actions.unstarred": "Unstarred.", + "entry_column.filtered_content_tip": "You have filtered content hidden.", + "entry_column.filtered_content_tip_2": "In addition to the entries shown above, there is also filtered content.", "entry_column.refreshing": "Refreshing new entries...", "entry_content.ai_summary": "AI summary", "entry_content.fetching_content": "Fetching original content and processing...", "entry_content.header.play_tts": "Play TTS", "entry_content.header.readability": "Readability", - "entry_content.no_content": "No content", + "entry_content.no_content": "No media available", "entry_content.readability_notice": "This content is provided by Readability. If you find typographical anomalies, please go to the source site to view the original content.", "entry_content.render_error": "Render error:", "entry_content.report_issue": "Report issue", diff --git a/src/renderer/src/modules/entry-column/Items/picture-item.tsx b/src/renderer/src/modules/entry-column/Items/picture-item.tsx index b66c845a7..7fe38da14 100644 --- a/src/renderer/src/modules/entry-column/Items/picture-item.tsx +++ b/src/renderer/src/modules/entry-column/Items/picture-item.tsx @@ -8,6 +8,7 @@ import { useEntry } from "@renderer/store/entry/hooks" import { useImageDimensions } from "@renderer/store/image" import type { PropsWithChildren } from "react" import { memo, useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { usePreviewMedia } from "../../../components/ui/media/hooks" import { EntryItemWrapper } from "../layouts/EntryItemWrapper" @@ -24,6 +25,7 @@ export function PictureItem({ entryId, entryPreview, translation }: UniversalIte const isActive = useRouteParamsSelector(({ entryId }) => entryId === entry?.entries.id) + const { t } = useTranslation() const previewMedia = usePreviewMedia() if (!entry) return return ( @@ -46,7 +48,7 @@ export function PictureItem({ entryId, entryPreview, translation }: UniversalIte ) : (
    - No media available + {t("entry_content.no_content")}
    )}
    @@ -97,7 +99,7 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({ /> ) : ( -
    +
    No media available
    diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index b76e195e1..96e0e4bcc 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -1,5 +1,5 @@ import { useGeneralSettingKey } from "@renderer/atoms/settings/general" -import { useUISettingKey } from "@renderer/atoms/settings/ui" +import { setUISetting, useUISettingKey } from "@renderer/atoms/settings/ui" import { m } from "@renderer/components/common/Motion" import { FeedFoundCanBeFollowError } from "@renderer/components/errors/FeedFoundCanBeFollowErrorFallback" import { FeedNotFound } from "@renderer/components/errors/FeedNotFound" @@ -248,23 +248,67 @@ const ListGird = ({ } return virtuosoOptions.data }, [virtuosoOptions.data, filterNoImage]) + const { t } = useTranslation() + if (nextData.length === 0 && virtuosoOptions.data.length > 0) { + return ( +
    + +
    + {t("entry_column.filtered_content_tip")} +
    + + +
    + ) + } + + const hasFilteredContent = nextData.length < virtuosoOptions.data.length + + const FilteredContentTip = hasFilteredContent && ( +
    + +
    {t("entry_column.filtered_content_tip_2")}
    + + +
    + ) + if (masonry && view === FeedViewType.Pictures) { return ( - virtuosoOptions.data.length} - endReached={virtuosoOptions.endReached} - data={nextData} - /> + <> + virtuosoOptions.data.length} + endReached={virtuosoOptions.endReached} + data={nextData} + /> + + {FilteredContentTip} + ) } return ( - + <> + + {FilteredContentTip} + ) } diff --git a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx index 5e558c079..2f26bac50 100644 --- a/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx +++ b/src/renderer/src/modules/entry-column/layouts/EntryListHeader.tsx @@ -188,7 +188,7 @@ const FilterNoImageButton = () => { enabled ? "entry_list_header.show_all_items" : "entry_list_header.hide_no_image_items", )} > - + ) } diff --git a/src/renderer/src/modules/settings/tabs/invitations.tsx b/src/renderer/src/modules/settings/tabs/invitations.tsx index 2443bf288..b528b1108 100644 --- a/src/renderer/src/modules/settings/tabs/invitations.tsx +++ b/src/renderer/src/modules/settings/tabs/invitations.tsx @@ -80,7 +80,7 @@ export const SettingInvitations = () => {
    - + {invitations.data?.length ? ( @@ -91,7 +91,7 @@ export const SettingInvitations = () => { {t("invitation.tableHeaders.creationTime")} - + {t("invitation.tableHeaders.usedBy")} From af32818261ca90008e3db9df234ed8c998faf205 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 15 Sep 2024 21:45:16 +0800 Subject: [PATCH 48/66] chore: ignore hono.ts for prettier --- package.json | 2 +- src/hono.ts | 9404 ++++++++++++++++++++------------------------------ 2 files changed, 3719 insertions(+), 5687 deletions(-) diff --git a/package.json b/package.json index 1348c65bf..ce75149bd 100644 --- a/package.json +++ b/package.json @@ -220,7 +220,7 @@ "lint-staged": { "*": "eslint --fix", "*.{js,jsx,ts,tsx,json}": [ - "prettier --ignore-path ./.gitignore --write " + "prettier --write " ] }, "bump": { diff --git a/src/hono.ts b/src/hono.ts index 4e00c4e6a..0a64aa422 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -1,5762 +1,3794 @@ -import * as hono_hono_base from "hono/hono-base" -import { HttpBindings } from "@hono/node-server" -import * as drizzle_orm from "drizzle-orm" -import { InferInsertModel } from "drizzle-orm" -import * as drizzle_orm_pg_core from "drizzle-orm/pg-core" -import * as zod from "zod" -import { z } from "zod" +import * as hono_hono_base from 'hono/hono-base'; +import { HttpBindings } from '@hono/node-server'; +import * as drizzle_orm from 'drizzle-orm'; +import { InferInsertModel } from 'drizzle-orm'; +import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core'; +import * as zod from 'zod'; +import { z } from 'zod'; type Env = { - Bindings: HttpBindings -} + Bindings: HttpBindings; +}; -declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]> -declare const conditionFieldSchema: z.ZodEnum<["view", "title", "site_url", "feed_url", "category"]> -declare const conditionOperatorSchema: z.ZodEnum< - ["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"] -> -declare const ruleFieldSchema: z.ZodEnum<["all", "title", "content", "author", "url", "order"]> -declare const ruleOperatorSchema: z.ZodEnum< - ["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"] -> +declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>; +declare const conditionFieldSchema: z.ZodEnum<["view", "title", "site_url", "feed_url", "category"]>; +declare const conditionOperatorSchema: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; +declare const ruleFieldSchema: z.ZodEnum<["all", "title", "content", "author", "url", "order"]>; +declare const ruleOperatorSchema: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "actions" - schema: undefined - columns: { - userId: drizzle_orm_pg_core.PgColumn< - { - name: "user_id" - tableName: "actions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - rules: drizzle_orm_pg_core.PgColumn< - { - name: "rules" - tableName: "actions" - dataType: "json" - columnType: "PgJsonb" - data: { - name: string - condition: { - field: z.infer - operator: z.infer - value: string - }[] - result: { - translation?: z.infer - summary?: boolean - readability?: boolean + name: "actions"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "actions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + rules: drizzle_orm_pg_core.PgColumn<{ + name: "rules"; + tableName: "actions"; + dataType: "json"; + columnType: "PgJsonb"; + data: { + name: string; + condition: { + field: z.infer; + operator: z.infer; + value: string; + }[]; + result: { + translation?: z.infer; + summary?: boolean; + readability?: boolean; + rewriteRules?: { + from: string; + to: string; + }[]; + blockRules?: { + field: z.infer; + operator: z.infer; + value: string | number; + }[]; + }; + }[]; + driverParam: unknown; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const actionsItemOpenAPISchema: z.ZodObject<{ + name: z.ZodString; + condition: z.ZodArray; + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; + value: z.ZodString; + }, "strip", z.ZodTypeAny, { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }, { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }>, "many">; + result: z.ZodObject<{ + translation: z.ZodOptional>; + summary: z.ZodOptional; + readability: z.ZodOptional; + rewriteRules: z.ZodOptional, "many">>; + blockRules: z.ZodOptional; + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; + value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }, "strip", z.ZodTypeAny, { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }, { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }>, "many">>; + }, "strip", z.ZodTypeAny, { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }, { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }>; +}, "strip", z.ZodTypeAny, { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; +}, { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; +}>; +declare const actionsOpenAPISchema: z.ZodObject>; +}, "rules">, { + rules: z.ZodNullable; + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; + value: z.ZodString; + }, "strip", z.ZodTypeAny, { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }, { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }>, "many">; + result: z.ZodObject<{ + translation: z.ZodOptional>; + summary: z.ZodOptional; + readability: z.ZodOptional; + rewriteRules: z.ZodOptional, "many">>; + blockRules: z.ZodOptional; + operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]>; + value: z.ZodUnion<[z.ZodString, z.ZodNumber]>; + }, "strip", z.ZodTypeAny, { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }, { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }>, "many">>; + }, "strip", z.ZodTypeAny, { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; rewriteRules?: { - from: string - to: string - }[] + from: string; + to: string; + }[] | undefined; blockRules?: { - field: z.infer - operator: z.infer - value: string | number - }[] - } - }[] - driverParam: unknown - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const actionsItemOpenAPISchema: z.ZodObject< - { - name: z.ZodString - condition: z.ZodArray< - z.ZodObject< - { - field: z.ZodEnum<["view", "title", "site_url", "feed_url", "category"]> - operator: z.ZodEnum<["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"]> - value: z.ZodString - }, - "strip", - z.ZodTypeAny, - { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }, - { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - } - >, - "many" - > - result: z.ZodObject< - { - translation: z.ZodOptional> - summary: z.ZodOptional - readability: z.ZodOptional - rewriteRules: z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - from: z.ZodString - to: z.ZodString - }, - "strip", - z.ZodTypeAny, - { - from: string - to: string - }, - { - from: string - to: string - } - >, - "many" - > - > - blockRules: z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - field: z.ZodEnum<["all", "title", "content", "author", "url", "order"]> - operator: z.ZodEnum< - ["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"] - > - value: z.ZodUnion<[z.ZodString, z.ZodNumber]> - }, - "strip", - z.ZodTypeAny, - { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }, - { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - } - >, - "many" - > - > - }, - "strip", - z.ZodTypeAny, - { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - }, - { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - } - > - }, - "strip", - z.ZodTypeAny, - { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - } - }, - { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - } - } -> -declare const actionsOpenAPISchema: z.ZodObject< - z.objectUtil.extendShape< - Omit< - { - userId: z.ZodString - rules: z.ZodNullable< - z.ZodType< - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null, - z.ZodTypeDef, - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - > - > - }, - "rules" - >, - { - rules: z.ZodNullable< - z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - name: z.ZodString - condition: z.ZodArray< - z.ZodObject< - { - field: z.ZodEnum<["view", "title", "site_url", "feed_url", "category"]> - operator: z.ZodEnum< - ["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"] - > - value: z.ZodString - }, - "strip", - z.ZodTypeAny, - { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }, - { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - } - >, - "many" - > - result: z.ZodObject< - { - translation: z.ZodOptional> - summary: z.ZodOptional - readability: z.ZodOptional - rewriteRules: z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - from: z.ZodString - to: z.ZodString - }, - "strip", - z.ZodTypeAny, - { - from: string - to: string - }, - { - from: string - to: string - } - >, - "many" - > - > - blockRules: z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - field: z.ZodEnum<["all", "title", "content", "author", "url", "order"]> - operator: z.ZodEnum< - ["contains", "not_contains", "eq", "not_eq", "gt", "lt", "regex"] - > - value: z.ZodUnion<[z.ZodString, z.ZodNumber]> - }, - "strip", - z.ZodTypeAny, - { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }, - { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - } - >, - "many" - > - > - }, - "strip", - z.ZodTypeAny, - { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - }, - { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - } - > - }, - "strip", - z.ZodTypeAny, - { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - } - }, - { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - } - } - >, - "many" - > - > - > - } - >, - "strip", - z.ZodTypeAny, - { - userId: string - rules?: - | { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - } - }[] - | null - | undefined - }, - { - userId: string - rules?: - | { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - | undefined - } - }[] - | null - | undefined - } -> -declare const actionsRelations: drizzle_orm.Relations< - "actions", - { - users: drizzle_orm.One<"user", true> - } -> -type ActionsModel = z.infer -type SettingsModel = Exclude["result"], undefined> + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }, { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }>; + }, "strip", z.ZodTypeAny, { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }, { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }>, "many">>>; +}>, "strip", z.ZodTypeAny, { + userId: string; + rules?: { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }[] | null | undefined; +}, { + userId: string; + rules?: { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }[] | null | undefined; +}>; +declare const actionsRelations: drizzle_orm.Relations<"actions", { + users: drizzle_orm.One<"user", true>; +}>; +type ActionsModel = z.infer; +type SettingsModel = Exclude["result"], undefined>; declare const collections: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "collections" - schema: undefined - columns: { - userId: drizzle_orm_pg_core.PgColumn< - { - name: "user_id" - tableName: "collections" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - feedId: drizzle_orm_pg_core.PgColumn< - { - name: "feedId" - tableName: "collections" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - entryId: drizzle_orm_pg_core.PgColumn< - { - name: "entry_id" - tableName: "collections" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - createdAt: drizzle_orm_pg_core.PgColumn< - { - name: "created_at" - tableName: "collections" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - view: drizzle_orm_pg_core.PgColumn< - { - name: "view" - tableName: "collections" - dataType: "number" - columnType: "PgSmallInt" - data: number - driverParam: string | number - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const collectionsOpenAPISchema: zod.ZodObject< - { - userId: zod.ZodString - feedId: zod.ZodString - entryId: zod.ZodString - createdAt: zod.ZodString - view: zod.ZodNumber - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - createdAt: string - userId: string - view: number - feedId: string - entryId: string - }, - { - createdAt: string - userId: string - view: number - feedId: string - entryId: string - } -> -declare const collectionsRelations: drizzle_orm.Relations< - "collections", - { - users: drizzle_orm.One<"user", true> - entries: drizzle_orm.One<"entries", true> - feeds: drizzle_orm.One<"feeds", true> - } -> + name: "collections"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "collections"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feedId"; + tableName: "collections"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + entryId: drizzle_orm_pg_core.PgColumn<{ + name: "entry_id"; + tableName: "collections"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "collections"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + view: drizzle_orm_pg_core.PgColumn<{ + name: "view"; + tableName: "collections"; + dataType: "number"; + columnType: "PgSmallInt"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const collectionsOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString; + feedId: zod.ZodString; + entryId: zod.ZodString; + createdAt: zod.ZodString; + view: zod.ZodNumber; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + createdAt: string; + userId: string; + view: number; + feedId: string; + entryId: string; +}, { + createdAt: string; + userId: string; + view: number; + feedId: string; + entryId: string; +}>; +declare const collectionsRelations: drizzle_orm.Relations<"collections", { + users: drizzle_orm.One<"user", true>; + entries: drizzle_orm.One<"entries", true>; + feeds: drizzle_orm.One<"feeds", true>; +}>; type MediaModel = { - url: string - type: "photo" | "video" - preview_image_url?: string - width?: number - height?: number -} + url: string; + type: "photo" | "video"; + preview_image_url?: string; + width?: number; + height?: number; +}; type AttachmentsModel = { - url: string - duration_in_seconds?: number - mime_type?: string - size_in_bytes?: number - title?: string -} + url: string; + duration_in_seconds?: number; + mime_type?: string; + size_in_bytes?: number; + title?: string; +}; declare const entries: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "entries" - schema: undefined - columns: { - id: drizzle_orm_pg_core.PgColumn< - { - name: "id" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: true - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - feedId: drizzle_orm_pg_core.PgColumn< - { - name: "feed_id" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - title: drizzle_orm_pg_core.PgColumn< - { - name: "title" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - url: drizzle_orm_pg_core.PgColumn< - { - name: "url" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - content: drizzle_orm_pg_core.PgColumn< - { - name: "content" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - description: drizzle_orm_pg_core.PgColumn< - { - name: "description" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - guid: drizzle_orm_pg_core.PgColumn< - { - name: "guid" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - author: drizzle_orm_pg_core.PgColumn< - { - name: "author" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - authorUrl: drizzle_orm_pg_core.PgColumn< - { - name: "author_url" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - authorAvatar: drizzle_orm_pg_core.PgColumn< - { - name: "author_avatar" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - insertedAt: drizzle_orm_pg_core.PgColumn< - { - name: "inserted_at" - tableName: "entries" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - publishedAt: drizzle_orm_pg_core.PgColumn< - { - name: "published_at" - tableName: "entries" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - media: drizzle_orm_pg_core.PgColumn< - { - name: "media" - tableName: "entries" - dataType: "json" - columnType: "PgJsonb" - data: MediaModel[] - driverParam: unknown - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - categories: drizzle_orm_pg_core.PgColumn< - { - name: "categories" - tableName: "entries" - dataType: "array" - columnType: "PgArray" - data: string[] - driverParam: string | string[] - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: drizzle_orm.Column< - { - name: "categories" - tableName: "entries" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - object, - object - > - generated: undefined - }, - {}, - {} - > - attachments: drizzle_orm_pg_core.PgColumn< - { - name: "attachments" - tableName: "entries" - dataType: "json" - columnType: "PgJsonb" - data: AttachmentsModel[] - driverParam: unknown - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const entriesOpenAPISchema: z.ZodObject< - z.objectUtil.extendShape< - Omit< - { - id: z.ZodString - feedId: z.ZodString - title: z.ZodNullable - url: z.ZodNullable - content: z.ZodNullable - description: z.ZodNullable - guid: z.ZodString - author: z.ZodNullable - authorUrl: z.ZodNullable - authorAvatar: z.ZodNullable - insertedAt: z.ZodString - publishedAt: z.ZodString - media: z.ZodNullable< - z.ZodType< - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null, - z.ZodTypeDef, - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - > - > - categories: z.ZodNullable> - attachments: z.ZodNullable< - z.ZodType< - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null, - z.ZodTypeDef, - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - } - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | ( - | string - | number - | boolean - | any - | any - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - )[] - | null - > - > - }, - "media" | "attachments" - >, - { - attachments: z.ZodNullable< - z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - url: z.ZodString - duration_in_seconds: z.ZodOptional - mime_type: z.ZodOptional - size_in_bytes: z.ZodOptional - title: z.ZodOptional - }, - "strip", - z.ZodTypeAny, - { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }, - { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - } - >, - "many" - > - > - > - media: z.ZodNullable< - z.ZodOptional< - z.ZodArray< - z.ZodObject< - { - url: z.ZodString - type: z.ZodEnum<["photo", "video"]> - width: z.ZodOptional - height: z.ZodOptional - preview_image_url: z.ZodOptional - }, - "strip", - z.ZodTypeAny, - { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }, - { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - } - >, - "many" - > - > - > - } - >, - "strip", - z.ZodTypeAny, - { - description: string | null - title: string | null - content: string | null - id: string - author: string | null - url: string | null - feedId: string - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - }, - { - description: string | null - title: string | null - content: string | null - id: string - author: string | null - url: string | null - feedId: string - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - } -> -declare const entriesRelations: drizzle_orm.Relations< - "entries", - { - feeds: drizzle_orm.One<"feeds", true> - collections: drizzle_orm.Many<"collections"> - feedPowerTokens: drizzle_orm.One<"feedPowerTokens", true> - entryReadHistories: drizzle_orm.One<"entryReadHistories", true> - } -> + name: "entries"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feed_id"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + title: drizzle_orm_pg_core.PgColumn<{ + name: "title"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + url: drizzle_orm_pg_core.PgColumn<{ + name: "url"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + content: drizzle_orm_pg_core.PgColumn<{ + name: "content"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + description: drizzle_orm_pg_core.PgColumn<{ + name: "description"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + guid: drizzle_orm_pg_core.PgColumn<{ + name: "guid"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + author: drizzle_orm_pg_core.PgColumn<{ + name: "author"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + authorUrl: drizzle_orm_pg_core.PgColumn<{ + name: "author_url"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + authorAvatar: drizzle_orm_pg_core.PgColumn<{ + name: "author_avatar"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + insertedAt: drizzle_orm_pg_core.PgColumn<{ + name: "inserted_at"; + tableName: "entries"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + publishedAt: drizzle_orm_pg_core.PgColumn<{ + name: "published_at"; + tableName: "entries"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + media: drizzle_orm_pg_core.PgColumn<{ + name: "media"; + tableName: "entries"; + dataType: "json"; + columnType: "PgJsonb"; + data: MediaModel[]; + driverParam: unknown; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + categories: drizzle_orm_pg_core.PgColumn<{ + name: "categories"; + tableName: "entries"; + dataType: "array"; + columnType: "PgArray"; + data: string[]; + driverParam: string | string[]; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: drizzle_orm.Column<{ + name: "categories"; + tableName: "entries"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, object, object>; + generated: undefined; + }, {}, {}>; + attachments: drizzle_orm_pg_core.PgColumn<{ + name: "attachments"; + tableName: "entries"; + dataType: "json"; + columnType: "PgJsonb"; + data: AttachmentsModel[]; + driverParam: unknown; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const entriesOpenAPISchema: z.ZodObject; + url: z.ZodNullable; + content: z.ZodNullable; + description: z.ZodNullable; + guid: z.ZodString; + author: z.ZodNullable; + authorUrl: z.ZodNullable; + authorAvatar: z.ZodNullable; + insertedAt: z.ZodString; + publishedAt: z.ZodString; + media: z.ZodNullable>; + categories: z.ZodNullable>; + attachments: z.ZodNullable>; +}, "media" | "attachments">, { + attachments: z.ZodNullable; + mime_type: z.ZodOptional; + size_in_bytes: z.ZodOptional; + title: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }, { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }>, "many">>>; + media: z.ZodNullable; + width: z.ZodOptional; + height: z.ZodOptional; + preview_image_url: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }, { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }>, "many">>>; +}>, "strip", z.ZodTypeAny, { + description: string | null; + title: string | null; + content: string | null; + id: string; + author: string | null; + url: string | null; + feedId: string; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; +}, { + description: string | null; + title: string | null; + content: string | null; + id: string; + author: string | null; + url: string | null; + feedId: string; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; +}>; +declare const entriesRelations: drizzle_orm.Relations<"entries", { + feeds: drizzle_orm.One<"feeds", true>; + collections: drizzle_orm.Many<"collections">; + feedPowerTokens: drizzle_orm.One<"feedPowerTokens", true>; + entryReadHistories: drizzle_orm.One<"entryReadHistories", true>; +}>; type EntriesModel = InferInsertModel & { - attachments?: AttachmentsModel[] | null - media?: MediaModel[] | null -} + attachments?: AttachmentsModel[] | null; + media?: MediaModel[] | null; +}; declare const entryReadHistories: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "entryReadHistories" - schema: undefined - columns: { - entryId: drizzle_orm_pg_core.PgColumn< - { - name: "entry_id" - tableName: "entryReadHistories" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - userIds: drizzle_orm_pg_core.PgColumn< - { - name: "user_ids" - tableName: "entryReadHistories" - dataType: "array" - columnType: "PgArray" - data: string[] - driverParam: string | string[] - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: drizzle_orm.Column< - { - name: "user_ids" - tableName: "entryReadHistories" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - object, - object - > - generated: undefined - }, - {}, - {} - > - readCount: drizzle_orm_pg_core.PgColumn< - { - name: "read_count" - tableName: "entryReadHistories" - dataType: "number" - columnType: "PgInteger" - data: number - driverParam: string | number - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const entryReadHistoriesRelations: drizzle_orm.Relations< - "entryReadHistories", - { - entry: drizzle_orm.One<"entries", true> - } -> -type EntryReadHistoriesModel = InferInsertModel -declare const entryReadHistoriesOpenAPISchema: z.ZodObject< - { - entryId: z.ZodString - userIds: z.ZodArray - readCount: z.ZodNumber - }, - z.UnknownKeysParam, - z.ZodTypeAny, - { - entryId: string - userIds: string[] - readCount: number - }, - { - entryId: string - userIds: string[] - readCount: number - } -> + name: "entryReadHistories"; + schema: undefined; + columns: { + entryId: drizzle_orm_pg_core.PgColumn<{ + name: "entry_id"; + tableName: "entryReadHistories"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userIds: drizzle_orm_pg_core.PgColumn<{ + name: "user_ids"; + tableName: "entryReadHistories"; + dataType: "array"; + columnType: "PgArray"; + data: string[]; + driverParam: string | string[]; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: drizzle_orm.Column<{ + name: "user_ids"; + tableName: "entryReadHistories"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, object, object>; + generated: undefined; + }, {}, {}>; + readCount: drizzle_orm_pg_core.PgColumn<{ + name: "read_count"; + tableName: "entryReadHistories"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const entryReadHistoriesRelations: drizzle_orm.Relations<"entryReadHistories", { + entry: drizzle_orm.One<"entries", true>; +}>; +type EntryReadHistoriesModel = InferInsertModel; +declare const entryReadHistoriesOpenAPISchema: z.ZodObject<{ + entryId: z.ZodString; + userIds: z.ZodArray; + readCount: z.ZodNumber; +}, z.UnknownKeysParam, z.ZodTypeAny, { + entryId: string; + userIds: string[]; + readCount: number; +}, { + entryId: string; + userIds: string[]; + readCount: number; +}>; declare const feeds: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "feeds" - schema: undefined - columns: { - id: drizzle_orm_pg_core.PgColumn< - { - name: "id" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: true - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - url: drizzle_orm_pg_core.PgColumn< - { - name: "url" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - title: drizzle_orm_pg_core.PgColumn< - { - name: "title" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - description: drizzle_orm_pg_core.PgColumn< - { - name: "description" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - siteUrl: drizzle_orm_pg_core.PgColumn< - { - name: "site_url" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - image: drizzle_orm_pg_core.PgColumn< - { - name: "image" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - checkedAt: drizzle_orm_pg_core.PgColumn< - { - name: "checked_at" - tableName: "feeds" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - lastModifiedHeader: drizzle_orm_pg_core.PgColumn< - { - name: "last_modified_header" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - etagHeader: drizzle_orm_pg_core.PgColumn< - { - name: "etag_header" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - ttl: drizzle_orm_pg_core.PgColumn< - { - name: "ttl" - tableName: "feeds" - dataType: "number" - columnType: "PgInteger" - data: number - driverParam: string | number - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - errorMessage: drizzle_orm_pg_core.PgColumn< - { - name: "error_message" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - errorAt: drizzle_orm_pg_core.PgColumn< - { - name: "error_at" - tableName: "feeds" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - ownerUserId: drizzle_orm_pg_core.PgColumn< - { - name: "owner_user_id" - tableName: "feeds" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const feedsOpenAPISchema: zod.ZodObject< - { - id: zod.ZodString - url: zod.ZodString - title: zod.ZodNullable - description: zod.ZodNullable - siteUrl: zod.ZodNullable - image: zod.ZodNullable - checkedAt: zod.ZodString - lastModifiedHeader: zod.ZodNullable - etagHeader: zod.ZodNullable - ttl: zod.ZodNullable - errorMessage: zod.ZodNullable - errorAt: zod.ZodNullable - ownerUserId: zod.ZodNullable - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - }, - { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - } -> -declare const feedsInputSchema: zod.ZodObject< - { - description: zod.ZodOptional> - title: zod.ZodOptional> - id: zod.ZodOptional - image: zod.ZodOptional> - url: zod.ZodString - siteUrl: zod.ZodOptional> - checkedAt: zod.ZodString - lastModifiedHeader: zod.ZodOptional> - etagHeader: zod.ZodOptional> - ttl: zod.ZodOptional> - errorMessage: zod.ZodOptional> - errorAt: zod.ZodOptional> - ownerUserId: zod.ZodOptional> - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - url: string - checkedAt: string - description?: string | null | undefined - title?: string | null | undefined - id?: string | undefined - image?: string | null | undefined - siteUrl?: string | null | undefined - lastModifiedHeader?: string | null | undefined - etagHeader?: string | null | undefined - ttl?: number | null | undefined - errorMessage?: string | null | undefined - errorAt?: string | null | undefined - ownerUserId?: string | null | undefined - }, - { - url: string - checkedAt: string - description?: string | null | undefined - title?: string | null | undefined - id?: string | undefined - image?: string | null | undefined - siteUrl?: string | null | undefined - lastModifiedHeader?: string | null | undefined - etagHeader?: string | null | undefined - ttl?: number | null | undefined - errorMessage?: string | null | undefined - errorAt?: string | null | undefined - ownerUserId?: string | null | undefined - } -> -declare const feedsRelations: drizzle_orm.Relations< - "feeds", - { - subscriptions: drizzle_orm.Many<"subscriptions"> - entries: drizzle_orm.Many<"entries"> - owner: drizzle_orm.One<"user", false> - } -> -type FeedModel = InferInsertModel + name: "feeds"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + url: drizzle_orm_pg_core.PgColumn<{ + name: "url"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + title: drizzle_orm_pg_core.PgColumn<{ + name: "title"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + description: drizzle_orm_pg_core.PgColumn<{ + name: "description"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + siteUrl: drizzle_orm_pg_core.PgColumn<{ + name: "site_url"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + image: drizzle_orm_pg_core.PgColumn<{ + name: "image"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + checkedAt: drizzle_orm_pg_core.PgColumn<{ + name: "checked_at"; + tableName: "feeds"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + lastModifiedHeader: drizzle_orm_pg_core.PgColumn<{ + name: "last_modified_header"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + etagHeader: drizzle_orm_pg_core.PgColumn<{ + name: "etag_header"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + ttl: drizzle_orm_pg_core.PgColumn<{ + name: "ttl"; + tableName: "feeds"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + errorMessage: drizzle_orm_pg_core.PgColumn<{ + name: "error_message"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + errorAt: drizzle_orm_pg_core.PgColumn<{ + name: "error_at"; + tableName: "feeds"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + ownerUserId: drizzle_orm_pg_core.PgColumn<{ + name: "owner_user_id"; + tableName: "feeds"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const feedsOpenAPISchema: zod.ZodObject<{ + id: zod.ZodString; + url: zod.ZodString; + title: zod.ZodNullable; + description: zod.ZodNullable; + siteUrl: zod.ZodNullable; + image: zod.ZodNullable; + checkedAt: zod.ZodString; + lastModifiedHeader: zod.ZodNullable; + etagHeader: zod.ZodNullable; + ttl: zod.ZodNullable; + errorMessage: zod.ZodNullable; + errorAt: zod.ZodNullable; + ownerUserId: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; +}, { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; +}>; +declare const feedsInputSchema: zod.ZodObject<{ + description: zod.ZodOptional>; + title: zod.ZodOptional>; + id: zod.ZodOptional; + image: zod.ZodOptional>; + url: zod.ZodString; + siteUrl: zod.ZodOptional>; + checkedAt: zod.ZodString; + lastModifiedHeader: zod.ZodOptional>; + etagHeader: zod.ZodOptional>; + ttl: zod.ZodOptional>; + errorMessage: zod.ZodOptional>; + errorAt: zod.ZodOptional>; + ownerUserId: zod.ZodOptional>; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + url: string; + checkedAt: string; + description?: string | null | undefined; + title?: string | null | undefined; + id?: string | undefined; + image?: string | null | undefined; + siteUrl?: string | null | undefined; + lastModifiedHeader?: string | null | undefined; + etagHeader?: string | null | undefined; + ttl?: number | null | undefined; + errorMessage?: string | null | undefined; + errorAt?: string | null | undefined; + ownerUserId?: string | null | undefined; +}, { + url: string; + checkedAt: string; + description?: string | null | undefined; + title?: string | null | undefined; + id?: string | undefined; + image?: string | null | undefined; + siteUrl?: string | null | undefined; + lastModifiedHeader?: string | null | undefined; + etagHeader?: string | null | undefined; + ttl?: number | null | undefined; + errorMessage?: string | null | undefined; + errorAt?: string | null | undefined; + ownerUserId?: string | null | undefined; +}>; +declare const feedsRelations: drizzle_orm.Relations<"feeds", { + subscriptions: drizzle_orm.Many<"subscriptions">; + entries: drizzle_orm.Many<"entries">; + owner: drizzle_orm.One<"user", false>; +}>; +type FeedModel = InferInsertModel; declare const invitations: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "invitations" - schema: undefined - columns: { - code: drizzle_orm_pg_core.PgColumn< - { - name: "code" - tableName: "invitations" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - createdAt: drizzle_orm_pg_core.PgColumn< - { - name: "created_at" - tableName: "invitations" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: false - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - fromUserId: drizzle_orm_pg_core.PgColumn< - { - name: "from_user_id" - tableName: "invitations" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - toUserId: drizzle_orm_pg_core.PgColumn< - { - name: "to_user_id" - tableName: "invitations" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const invitationsOpenAPISchema: zod.ZodObject< - { - code: zod.ZodString - createdAt: zod.ZodNullable - fromUserId: zod.ZodString - toUserId: zod.ZodNullable - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - code: string - createdAt: string | null - fromUserId: string - toUserId: string | null - }, - { - code: string - createdAt: string | null - fromUserId: string - toUserId: string | null - } -> -declare const invitationsRelations: drizzle_orm.Relations< - "invitations", - { - users: drizzle_orm.One<"user", false> - } -> + name: "invitations"; + schema: undefined; + columns: { + code: drizzle_orm_pg_core.PgColumn<{ + name: "code"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "invitations"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + fromUserId: drizzle_orm_pg_core.PgColumn<{ + name: "from_user_id"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + toUserId: drizzle_orm_pg_core.PgColumn<{ + name: "to_user_id"; + tableName: "invitations"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const invitationsOpenAPISchema: zod.ZodObject<{ + code: zod.ZodString; + createdAt: zod.ZodNullable; + fromUserId: zod.ZodString; + toUserId: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + code: string; + createdAt: string | null; + fromUserId: string; + toUserId: string | null; +}, { + code: string; + createdAt: string | null; + fromUserId: string; + toUserId: string | null; +}>; +declare const invitationsRelations: drizzle_orm.Relations<"invitations", { + users: drizzle_orm.One<"user", false>; +}>; declare const settings: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "settings" - schema: undefined - columns: { - id: drizzle_orm_pg_core.PgColumn< - { - name: "id" - tableName: "settings" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: true - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - userId: drizzle_orm_pg_core.PgColumn< - { - name: "user_id" - tableName: "settings" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - tab: drizzle_orm_pg_core.PgColumn< - { - name: "tab" - tableName: "settings" - dataType: "string" - columnType: "PgText" - data: "general" | "appearance" | "integration" - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: ["general", "appearance", "integration"] - baseColumn: never - generated: undefined - }, - {}, - {} - > - payload: drizzle_orm_pg_core.PgColumn< - { - name: "payload" - tableName: "settings" - dataType: "json" - columnType: "PgJsonb" - data: Record - driverParam: unknown - notNull: false - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - updateAt: drizzle_orm_pg_core.PgColumn< - { - name: "update_at" - tableName: "settings" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - version: drizzle_orm_pg_core.PgColumn< - { - name: "version" - tableName: "settings" - dataType: "number" - columnType: "PgInteger" - data: number - driverParam: string | number - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> + name: "settings"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + tab: drizzle_orm_pg_core.PgColumn<{ + name: "tab"; + tableName: "settings"; + dataType: "string"; + columnType: "PgText"; + data: "general" | "appearance" | "integration"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["general", "appearance", "integration"]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + payload: drizzle_orm_pg_core.PgColumn<{ + name: "payload"; + tableName: "settings"; + dataType: "json"; + columnType: "PgJsonb"; + data: Record; + driverParam: unknown; + notNull: false; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + updateAt: drizzle_orm_pg_core.PgColumn<{ + name: "update_at"; + tableName: "settings"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + version: drizzle_orm_pg_core.PgColumn<{ + name: "version"; + tableName: "settings"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; declare const subscriptions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "subscriptions" - schema: undefined - columns: { - userId: drizzle_orm_pg_core.PgColumn< - { - name: "user_id" - tableName: "subscriptions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - feedId: drizzle_orm_pg_core.PgColumn< - { - name: "feed_id" - tableName: "subscriptions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - view: drizzle_orm_pg_core.PgColumn< - { - name: "view" - tableName: "subscriptions" - dataType: "number" - columnType: "PgSmallInt" - data: number - driverParam: string | number - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - category: drizzle_orm_pg_core.PgColumn< - { - name: "category" - tableName: "subscriptions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - title: drizzle_orm_pg_core.PgColumn< - { - name: "title" - tableName: "subscriptions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - isPrivate: drizzle_orm_pg_core.PgColumn< - { - name: "is_private" - tableName: "subscriptions" - dataType: "boolean" - columnType: "PgBoolean" - data: boolean - driverParam: boolean - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const subscriptionsOpenAPISchema: zod.ZodObject< - { - userId: zod.ZodString - feedId: zod.ZodString - view: zod.ZodNumber - category: zod.ZodNullable - title: zod.ZodNullable - isPrivate: zod.ZodBoolean - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - title: string | null - userId: string - view: number - category: string | null - feedId: string - isPrivate: boolean - }, - { - title: string | null - userId: string - view: number - category: string | null - feedId: string - isPrivate: boolean - } -> -declare const subscriptionsRelations: drizzle_orm.Relations< - "subscriptions", - { - users: drizzle_orm.One<"user", true> - feeds: drizzle_orm.One<"feeds", true> - } -> + name: "subscriptions"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feed_id"; + tableName: "subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + view: drizzle_orm_pg_core.PgColumn<{ + name: "view"; + tableName: "subscriptions"; + dataType: "number"; + columnType: "PgSmallInt"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + category: drizzle_orm_pg_core.PgColumn<{ + name: "category"; + tableName: "subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + title: drizzle_orm_pg_core.PgColumn<{ + name: "title"; + tableName: "subscriptions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + isPrivate: drizzle_orm_pg_core.PgColumn<{ + name: "is_private"; + tableName: "subscriptions"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const subscriptionsOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString; + feedId: zod.ZodString; + view: zod.ZodNumber; + category: zod.ZodNullable; + title: zod.ZodNullable; + isPrivate: zod.ZodBoolean; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + title: string | null; + userId: string; + view: number; + category: string | null; + feedId: string; + isPrivate: boolean; +}, { + title: string | null; + userId: string; + view: number; + category: string | null; + feedId: string; + isPrivate: boolean; +}>; +declare const subscriptionsRelations: drizzle_orm.Relations<"subscriptions", { + users: drizzle_orm.One<"user", true>; + feeds: drizzle_orm.One<"feeds", true>; +}>; declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "timeline" - schema: undefined - columns: { - userId: drizzle_orm_pg_core.PgColumn< - { - name: "user_id" - tableName: "timeline" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - feedId: drizzle_orm_pg_core.PgColumn< - { - name: "feedId" - tableName: "timeline" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - entryId: drizzle_orm_pg_core.PgColumn< - { - name: "entry_id" - tableName: "timeline" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - publishedAt: drizzle_orm_pg_core.PgColumn< - { - name: "published_at" - tableName: "timeline" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - insertedAt: drizzle_orm_pg_core.PgColumn< - { - name: "inserted_at" - tableName: "timeline" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - view: drizzle_orm_pg_core.PgColumn< - { - name: "view" - tableName: "timeline" - dataType: "number" - columnType: "PgSmallInt" - data: number - driverParam: string | number - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - read: drizzle_orm_pg_core.PgColumn< - { - name: "read" - tableName: "timeline" - dataType: "boolean" - columnType: "PgBoolean" - data: boolean - driverParam: boolean - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const timelineOpenAPISchema: zod.ZodObject< - { - userId: zod.ZodString - feedId: zod.ZodString - entryId: zod.ZodString - publishedAt: zod.ZodString - insertedAt: zod.ZodString - view: zod.ZodNumber - read: zod.ZodNullable - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - userId: string - view: number - feedId: string - insertedAt: string - publishedAt: string - entryId: string - read: boolean | null - }, - { - userId: string - view: number - feedId: string - insertedAt: string - publishedAt: string - entryId: string - read: boolean | null - } -> -declare const timelineRelations: drizzle_orm.Relations< - "timeline", - { - entries: drizzle_orm.One<"entries", true> - feeds: drizzle_orm.One<"feeds", true> - collections: drizzle_orm.One<"collections", true> - } -> + name: "timeline"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "user_id"; + tableName: "timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feedId"; + tableName: "timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + entryId: drizzle_orm_pg_core.PgColumn<{ + name: "entry_id"; + tableName: "timeline"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + publishedAt: drizzle_orm_pg_core.PgColumn<{ + name: "published_at"; + tableName: "timeline"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + insertedAt: drizzle_orm_pg_core.PgColumn<{ + name: "inserted_at"; + tableName: "timeline"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + view: drizzle_orm_pg_core.PgColumn<{ + name: "view"; + tableName: "timeline"; + dataType: "number"; + columnType: "PgSmallInt"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + read: drizzle_orm_pg_core.PgColumn<{ + name: "read"; + tableName: "timeline"; + dataType: "boolean"; + columnType: "PgBoolean"; + data: boolean; + driverParam: boolean; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const timelineOpenAPISchema: zod.ZodObject<{ + userId: zod.ZodString; + feedId: zod.ZodString; + entryId: zod.ZodString; + publishedAt: zod.ZodString; + insertedAt: zod.ZodString; + view: zod.ZodNumber; + read: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + userId: string; + view: number; + feedId: string; + insertedAt: string; + publishedAt: string; + entryId: string; + read: boolean | null; +}, { + userId: string; + view: number; + feedId: string; + insertedAt: string; + publishedAt: string; + entryId: string; + read: boolean | null; +}>; +declare const timelineRelations: drizzle_orm.Relations<"timeline", { + entries: drizzle_orm.One<"entries", true>; + feeds: drizzle_orm.One<"feeds", true>; + collections: drizzle_orm.One<"collections", true>; +}>; declare const users: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "user" - schema: undefined - columns: { - id: drizzle_orm_pg_core.PgColumn< - { - name: "id" - tableName: "user" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: true - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - name: drizzle_orm_pg_core.PgColumn< - { - name: "name" - tableName: "user" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - email: drizzle_orm_pg_core.PgColumn< - { - name: "email" - tableName: "user" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - emailVerified: drizzle_orm_pg_core.PgColumn< - { - name: "emailVerified" - tableName: "user" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - image: drizzle_orm_pg_core.PgColumn< - { - name: "image" - tableName: "user" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - handle: drizzle_orm_pg_core.PgColumn< - { - name: "handle" - tableName: "user" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - createdAt: drizzle_orm_pg_core.PgColumn< - { - name: "created_at" - tableName: "user" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const usersOpenApiSchema: z.ZodObject< - Omit< - { - id: z.ZodString - name: z.ZodNullable - email: z.ZodString - emailVerified: z.ZodNullable - image: z.ZodNullable - handle: z.ZodNullable - createdAt: z.ZodDate - }, - "email" - >, - z.UnknownKeysParam, - z.ZodTypeAny, - { - name: string | null - id: string - emailVerified: string | null - image: string | null - handle: string | null - createdAt: Date - }, - { - name: string | null - id: string - emailVerified: string | null - image: string | null - handle: string | null - createdAt: Date - } -> + name: "user"; + schema: undefined; + columns: { + id: drizzle_orm_pg_core.PgColumn<{ + name: "id"; + tableName: "user"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: true; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + name: drizzle_orm_pg_core.PgColumn<{ + name: "name"; + tableName: "user"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + email: drizzle_orm_pg_core.PgColumn<{ + name: "email"; + tableName: "user"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + emailVerified: drizzle_orm_pg_core.PgColumn<{ + name: "emailVerified"; + tableName: "user"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + image: drizzle_orm_pg_core.PgColumn<{ + name: "image"; + tableName: "user"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + handle: drizzle_orm_pg_core.PgColumn<{ + name: "handle"; + tableName: "user"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "user"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const usersOpenApiSchema: z.ZodObject; + email: z.ZodString; + emailVerified: z.ZodNullable; + image: z.ZodNullable; + handle: z.ZodNullable; + createdAt: z.ZodDate; +}, "email">, z.UnknownKeysParam, z.ZodTypeAny, { + name: string | null; + id: string; + emailVerified: string | null; + image: string | null; + handle: string | null; + createdAt: Date; +}, { + name: string | null; + id: string; + emailVerified: string | null; + image: string | null; + handle: string | null; + createdAt: Date; +}>; declare const accounts: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "account" - schema: undefined - columns: { - userId: drizzle_orm_pg_core.PgColumn< - { - name: "userId" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - type: drizzle_orm_pg_core.PgColumn< - { - name: "type" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - provider: drizzle_orm_pg_core.PgColumn< - { - name: "provider" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - providerAccountId: drizzle_orm_pg_core.PgColumn< - { - name: "providerAccountId" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - refresh_token: drizzle_orm_pg_core.PgColumn< - { - name: "refresh_token" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - access_token: drizzle_orm_pg_core.PgColumn< - { - name: "access_token" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - expires_at: drizzle_orm_pg_core.PgColumn< - { - name: "expires_at" - tableName: "account" - dataType: "number" - columnType: "PgInteger" - data: number - driverParam: string | number - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - token_type: drizzle_orm_pg_core.PgColumn< - { - name: "token_type" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - scope: drizzle_orm_pg_core.PgColumn< - { - name: "scope" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - id_token: drizzle_orm_pg_core.PgColumn< - { - name: "id_token" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - session_state: drizzle_orm_pg_core.PgColumn< - { - name: "session_state" - tableName: "account" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> + name: "account"; + schema: undefined; + columns: { + userId: drizzle_orm_pg_core.PgColumn<{ + name: "userId"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + type: drizzle_orm_pg_core.PgColumn<{ + name: "type"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + provider: drizzle_orm_pg_core.PgColumn<{ + name: "provider"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + providerAccountId: drizzle_orm_pg_core.PgColumn<{ + name: "providerAccountId"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + refresh_token: drizzle_orm_pg_core.PgColumn<{ + name: "refresh_token"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + access_token: drizzle_orm_pg_core.PgColumn<{ + name: "access_token"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + expires_at: drizzle_orm_pg_core.PgColumn<{ + name: "expires_at"; + tableName: "account"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + token_type: drizzle_orm_pg_core.PgColumn<{ + name: "token_type"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + scope: drizzle_orm_pg_core.PgColumn<{ + name: "scope"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + id_token: drizzle_orm_pg_core.PgColumn<{ + name: "id_token"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + session_state: drizzle_orm_pg_core.PgColumn<{ + name: "session_state"; + tableName: "account"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; declare const sessions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "session" - schema: undefined - columns: { - sessionToken: drizzle_orm_pg_core.PgColumn< - { - name: "sessionToken" - tableName: "session" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - userId: drizzle_orm_pg_core.PgColumn< - { - name: "userId" - tableName: "session" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - expires: drizzle_orm_pg_core.PgColumn< - { - name: "expires" - tableName: "session" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> + name: "session"; + schema: undefined; + columns: { + sessionToken: drizzle_orm_pg_core.PgColumn<{ + name: "sessionToken"; + tableName: "session"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userId: drizzle_orm_pg_core.PgColumn<{ + name: "userId"; + tableName: "session"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + expires: drizzle_orm_pg_core.PgColumn<{ + name: "expires"; + tableName: "session"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; declare const verificationTokens: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "verificationToken" - schema: undefined - columns: { - identifier: drizzle_orm_pg_core.PgColumn< - { - name: "identifier" - tableName: "verificationToken" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - token: drizzle_orm_pg_core.PgColumn< - { - name: "token" - tableName: "verificationToken" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - expires: drizzle_orm_pg_core.PgColumn< - { - name: "expires" - tableName: "verificationToken" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const usersRelations: drizzle_orm.Relations< - "user", - { - subscriptions: drizzle_orm.Many<"subscriptions"> - collections: drizzle_orm.Many<"collections"> - actions: drizzle_orm.One<"actions", true> - wallets: drizzle_orm.One<"wallets", true> - feeds: drizzle_orm.Many<"feeds"> - } -> + name: "verificationToken"; + schema: undefined; + columns: { + identifier: drizzle_orm_pg_core.PgColumn<{ + name: "identifier"; + tableName: "verificationToken"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + token: drizzle_orm_pg_core.PgColumn<{ + name: "token"; + tableName: "verificationToken"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + expires: drizzle_orm_pg_core.PgColumn<{ + name: "expires"; + tableName: "verificationToken"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const usersRelations: drizzle_orm.Relations<"user", { + subscriptions: drizzle_orm.Many<"subscriptions">; + collections: drizzle_orm.Many<"collections">; + actions: drizzle_orm.One<"actions", true>; + wallets: drizzle_orm.One<"wallets", true>; + feeds: drizzle_orm.Many<"feeds">; +}>; declare const wallets: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "wallets" - schema: undefined - columns: { - addressIndex: drizzle_orm_pg_core.PgColumn< - { - name: "address_index" - tableName: "wallets" - dataType: "number" - columnType: "PgInteger" - data: number - driverParam: string | number - notNull: true - hasDefault: true - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: drizzle_orm.GeneratedColumnConfig & { - as: any - type: "always" - } - }, - {}, - {} - > - address: drizzle_orm_pg_core.PgColumn< - { - name: "address" - tableName: "wallets" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - userId: drizzle_orm_pg_core.PgColumn< - { - name: "userId" - tableName: "wallets" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - createdAt: drizzle_orm_pg_core.PgColumn< - { - name: "created_at" - tableName: "wallets" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - dailyPowerToken: drizzle_orm_pg_core.PgColumn< - { - name: "daily_power_token" - tableName: "wallets" - dataType: "string" - columnType: "PgNumeric" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - cashablePowerToken: drizzle_orm_pg_core.PgColumn< - { - name: "cashable_power_token" - tableName: "wallets" - dataType: "string" - columnType: "PgNumeric" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const walletsOpenAPISchema: zod.ZodObject< - { - addressIndex: zod.ZodNumber - address: zod.ZodNullable - userId: zod.ZodString - createdAt: zod.ZodString - dailyPowerToken: zod.ZodString - cashablePowerToken: zod.ZodString - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - createdAt: string - userId: string - address: string | null - addressIndex: number - dailyPowerToken: string - cashablePowerToken: string - }, - { - createdAt: string - userId: string - address: string | null - addressIndex: number - dailyPowerToken: string - cashablePowerToken: string - } -> -declare const walletsRelations: drizzle_orm.Relations< - "wallets", - { - user: drizzle_orm.One<"user", true> - transactionsFrom: drizzle_orm.Many<"transactions"> - transactionTo: drizzle_orm.Many<"transactions"> - } -> -declare const transactionType: drizzle_orm_pg_core.PgEnum< - ["tip", "mint", "burn", "withdraw", "purchase"] -> + name: "wallets"; + schema: undefined; + columns: { + addressIndex: drizzle_orm_pg_core.PgColumn<{ + name: "address_index"; + tableName: "wallets"; + dataType: "number"; + columnType: "PgInteger"; + data: number; + driverParam: string | number; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: drizzle_orm.GeneratedColumnConfig & { + as: any; + type: "always"; + }; + }, {}, {}>; + address: drizzle_orm_pg_core.PgColumn<{ + name: "address"; + tableName: "wallets"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + userId: drizzle_orm_pg_core.PgColumn<{ + name: "userId"; + tableName: "wallets"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "wallets"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + dailyPowerToken: drizzle_orm_pg_core.PgColumn<{ + name: "daily_power_token"; + tableName: "wallets"; + dataType: "string"; + columnType: "PgNumeric"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + cashablePowerToken: drizzle_orm_pg_core.PgColumn<{ + name: "cashable_power_token"; + tableName: "wallets"; + dataType: "string"; + columnType: "PgNumeric"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const walletsOpenAPISchema: zod.ZodObject<{ + addressIndex: zod.ZodNumber; + address: zod.ZodNullable; + userId: zod.ZodString; + createdAt: zod.ZodString; + dailyPowerToken: zod.ZodString; + cashablePowerToken: zod.ZodString; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + createdAt: string; + userId: string; + address: string | null; + addressIndex: number; + dailyPowerToken: string; + cashablePowerToken: string; +}, { + createdAt: string; + userId: string; + address: string | null; + addressIndex: number; + dailyPowerToken: string; + cashablePowerToken: string; +}>; +declare const walletsRelations: drizzle_orm.Relations<"wallets", { + user: drizzle_orm.One<"user", true>; + transactionsFrom: drizzle_orm.Many<"transactions">; + transactionTo: drizzle_orm.Many<"transactions">; +}>; +declare const transactionType: drizzle_orm_pg_core.PgEnum<["tip", "mint", "burn", "withdraw", "purchase"]>; declare const transactions: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "transactions" - schema: undefined - columns: { - hash: drizzle_orm_pg_core.PgColumn< - { - name: "hash" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - type: drizzle_orm_pg_core.PgColumn< - { - name: "type" - tableName: "transactions" - dataType: "string" - columnType: "PgEnumColumn" - data: "tip" | "mint" | "burn" | "withdraw" | "purchase" - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: ["tip", "mint", "burn", "withdraw", "purchase"] - baseColumn: never - generated: undefined - }, - {}, - {} - > - fromUserId: drizzle_orm_pg_core.PgColumn< - { - name: "from_user_id" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - toUserId: drizzle_orm_pg_core.PgColumn< - { - name: "to_user_id" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - toFeedId: drizzle_orm_pg_core.PgColumn< - { - name: "to_feed_id" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - toEntryId: drizzle_orm_pg_core.PgColumn< - { - name: "to_entry_id" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - powerToken: drizzle_orm_pg_core.PgColumn< - { - name: "power_token" - tableName: "transactions" - dataType: "string" - columnType: "PgNumeric" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - createdAt: drizzle_orm_pg_core.PgColumn< - { - name: "created_at" - tableName: "transactions" - dataType: "date" - columnType: "PgTimestamp" - data: Date - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - comment: drizzle_orm_pg_core.PgColumn< - { - name: "comment" - tableName: "transactions" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: false - hasDefault: false - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const transactionsOpenAPISchema: zod.ZodObject< - { - hash: zod.ZodString - type: zod.ZodEnum<["tip", "mint", "burn", "withdraw", "purchase"]> - fromUserId: zod.ZodNullable - toUserId: zod.ZodNullable - toFeedId: zod.ZodNullable - toEntryId: zod.ZodNullable - powerToken: zod.ZodString - createdAt: zod.ZodString - comment: zod.ZodNullable - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" - createdAt: string - fromUserId: string | null - toUserId: string | null - hash: string - toFeedId: string | null - toEntryId: string | null - powerToken: string - comment: string | null - }, - { - type: "tip" | "mint" | "burn" | "withdraw" | "purchase" - createdAt: string - fromUserId: string | null - toUserId: string | null - hash: string - toFeedId: string | null - toEntryId: string | null - powerToken: string - comment: string | null - } -> -declare const transactionsRelations: drizzle_orm.Relations< - "transactions", - { - fromUser: drizzle_orm.One<"user", false> - toUser: drizzle_orm.One<"user", false> - toFeed: drizzle_orm.One<"feeds", false> - fromWallet: drizzle_orm.One<"wallets", false> - toWallet: drizzle_orm.One<"wallets", false> - } -> + name: "transactions"; + schema: undefined; + columns: { + hash: drizzle_orm_pg_core.PgColumn<{ + name: "hash"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + type: drizzle_orm_pg_core.PgColumn<{ + name: "type"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgEnumColumn"; + data: "tip" | "mint" | "burn" | "withdraw" | "purchase"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["tip", "mint", "burn", "withdraw", "purchase"]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + fromUserId: drizzle_orm_pg_core.PgColumn<{ + name: "from_user_id"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + toUserId: drizzle_orm_pg_core.PgColumn<{ + name: "to_user_id"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + toFeedId: drizzle_orm_pg_core.PgColumn<{ + name: "to_feed_id"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + toEntryId: drizzle_orm_pg_core.PgColumn<{ + name: "to_entry_id"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + powerToken: drizzle_orm_pg_core.PgColumn<{ + name: "power_token"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgNumeric"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + createdAt: drizzle_orm_pg_core.PgColumn<{ + name: "created_at"; + tableName: "transactions"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + comment: drizzle_orm_pg_core.PgColumn<{ + name: "comment"; + tableName: "transactions"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const transactionsOpenAPISchema: zod.ZodObject<{ + hash: zod.ZodString; + type: zod.ZodEnum<["tip", "mint", "burn", "withdraw", "purchase"]>; + fromUserId: zod.ZodNullable; + toUserId: zod.ZodNullable; + toFeedId: zod.ZodNullable; + toEntryId: zod.ZodNullable; + powerToken: zod.ZodString; + createdAt: zod.ZodString; + comment: zod.ZodNullable; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + type: "tip" | "mint" | "burn" | "withdraw" | "purchase"; + createdAt: string; + fromUserId: string | null; + toUserId: string | null; + hash: string; + toFeedId: string | null; + toEntryId: string | null; + powerToken: string; + comment: string | null; +}, { + type: "tip" | "mint" | "burn" | "withdraw" | "purchase"; + createdAt: string; + fromUserId: string | null; + toUserId: string | null; + hash: string; + toFeedId: string | null; + toEntryId: string | null; + powerToken: string; + comment: string | null; +}>; +declare const transactionsRelations: drizzle_orm.Relations<"transactions", { + fromUser: drizzle_orm.One<"user", false>; + toUser: drizzle_orm.One<"user", false>; + toFeed: drizzle_orm.One<"feeds", false>; + fromWallet: drizzle_orm.One<"wallets", false>; + toWallet: drizzle_orm.One<"wallets", false>; +}>; declare const feedPowerTokens: drizzle_orm_pg_core.PgTableWithColumns<{ - name: "feedPowerTokens" - schema: undefined - columns: { - feedId: drizzle_orm_pg_core.PgColumn< - { - name: "feed_id" - tableName: "feedPowerTokens" - dataType: "string" - columnType: "PgText" - data: string - driverParam: string - notNull: true - hasDefault: false - isPrimaryKey: true - isAutoincrement: false - hasRuntimeDefault: false - enumValues: [string, ...string[]] - baseColumn: never - generated: undefined - }, - {}, - {} - > - powerToken: drizzle_orm_pg_core.PgColumn< - { - name: "power_token" - tableName: "feedPowerTokens" - dataType: "string" - columnType: "PgNumeric" - data: string - driverParam: string - notNull: true - hasDefault: true - isPrimaryKey: false - isAutoincrement: false - hasRuntimeDefault: false - enumValues: undefined - baseColumn: never - generated: undefined - }, - {}, - {} - > - } - dialect: "pg" -}> -declare const feedPowerTokensOpenAPISchema: zod.ZodObject< - { - feedId: zod.ZodString - powerToken: zod.ZodString - }, - zod.UnknownKeysParam, - zod.ZodTypeAny, - { - feedId: string - powerToken: string - }, - { - feedId: string - powerToken: string - } -> -declare const feedPowerTokensRelations: drizzle_orm.Relations< - "feedPowerTokens", - { - feed: drizzle_orm.One<"feeds", true> - } -> + name: "feedPowerTokens"; + schema: undefined; + columns: { + feedId: drizzle_orm_pg_core.PgColumn<{ + name: "feed_id"; + tableName: "feedPowerTokens"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + generated: undefined; + }, {}, {}>; + powerToken: drizzle_orm_pg_core.PgColumn<{ + name: "power_token"; + tableName: "feedPowerTokens"; + dataType: "string"; + columnType: "PgNumeric"; + data: string; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +declare const feedPowerTokensOpenAPISchema: zod.ZodObject<{ + feedId: zod.ZodString; + powerToken: zod.ZodString; +}, zod.UnknownKeysParam, zod.ZodTypeAny, { + feedId: string; + powerToken: string; +}, { + feedId: string; + powerToken: string; +}>; +declare const feedPowerTokensRelations: drizzle_orm.Relations<"feedPowerTokens", { + feed: drizzle_orm.One<"feeds", true>; +}>; -declare const _routes: hono_hono_base.HonoBase< - Env, - { +declare const _routes: hono_hono_base.HonoBase - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $patch: { + input: { + param: { + tab: string; + }; + } & { + json: Record; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/reads": { - $post: { - input: { - json: { - entryIds: string[] - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - $delete: { - input: { - json: { - entryId: string - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - $get: { - input: { - query: { - view?: string | string[] | undefined - } - } - output: { - code: 0 - data: { - [x: string]: number - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + entryIds: string[]; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $delete: { + input: { + json: { + entryId: string; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $get: { + input: { + query: { + view?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data: { + [x: string]: number; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/reads/all": { - $post: { - input: { - json: { - view?: number | undefined - feedIdList?: string[] | undefined - feedId?: string | undefined - startTime?: number | undefined - endTime?: number | undefined - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + view?: number | undefined; + feedIdList?: string[] | undefined; + feedId?: string | undefined; + startTime?: number | undefined; + endTime?: number | undefined; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/reads/total-count": { - $get: { - input: {} - output: { - code: 0 - data: { - count: number - } - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: {}; + output: { + code: 0; + data: { + count: number; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/profiles": { - $get: { - input: { - query: { - id: string | string[] - } - } - output: { - code: 0 - data: { - name: string | null - id: string - emailVerified: string | null - image: string | null - handle: string | null - createdAt: string - } - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + id: string | string[]; + }; + }; + output: { + code: 0; + data: { + name: string | null; + id: string; + emailVerified: string | null; + image: string | null; + handle: string | null; + createdAt: string; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/metrics": { - $get: { - input: { - query: { - type?: string | string[] | undefined - } - } - output: { - code: 0 - data: { - data: number[] - meta: { - count: number - prevTS: number - prevCount: number - } - count: number - } - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + type?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data: { + data: number[]; + meta: { + count: number; + prevTS: number; + prevCount: number; + }; + count: number; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/invitations/new": { - $post: { - input: {} - output: { - code: 0 - data: string - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: {}; + output: { + code: 0; + data: string; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/invitations/use": { - $post: { - input: { - json: { - code: string - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + code: string; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/invitations": { - $get: { - input: {} - output: { - code: 0 - data: { - code: string - createdAt: string | null - users: { - name: string | null - id: string - image: string | null - } | null - toUserId: string | null - }[] - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: {}; + output: { + code: 0; + data: { + code: string; + createdAt: string | null; + users: { + name: string | null; + id: string; + image: string | null; + } | null; + toUserId: string | null; + }[]; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/invitations/limitation": { - $get: { - input: {} - output: { - code: 0 - data: number - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: {}; + output: { + code: 0; + data: number; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/feeds/claim/message": { - $get: { - input: { - query: { - feedId: string | string[] - } - } - output: { - code: 0 - data: { - json: string - description: string - xml: string - content: string - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + query: { + feedId: string | string[]; + }; + }; + output: { + code: 0; + data: { + json: string; + description: string; + xml: string; + content: string; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/feeds/claim/challenge": { - $post: { - input: { - json: { - feedId: string - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + feedId: string; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/feeds/claim/list": { - $get: { - input: {} - output: { - code: 0 - data: { - feed: { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - } - subscriptionCount: number - tipAmount: number - entryCount: number - }[] - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: {}; + output: { + code: 0; + data: { + feed: { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; + }; + subscriptionCount: number; + tipAmount: number; + entryCount: number; + }[]; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/feeds": { - $get: { - input: { - query: { - id?: string | string[] | undefined - url?: string | string[] | undefined - } - } - output: { - code: 0 - data: { - feed: { - url: string - checkedAt: string - description?: string | null | undefined - title?: string | null | undefined - id?: string | undefined - image?: string | null | undefined - siteUrl?: string | null | undefined - lastModifiedHeader?: string | null | undefined - etagHeader?: string | null | undefined - ttl?: number | null | undefined - errorMessage?: string | null | undefined - errorAt?: string | null | undefined - ownerUserId?: string | null | undefined - } - subscriptionCount: number - readCount: number - subscription?: - | { - title: string | null - userId: string - view: number - category: string | null - feedId: string - isPrivate: boolean - } - | undefined - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + query: { + id?: string | string[] | undefined; + url?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data: { + feed: { + url: string; + checkedAt: string; + description?: string | null | undefined; + title?: string | null | undefined; + id?: string | undefined; + image?: string | null | undefined; + siteUrl?: string | null | undefined; + lastModifiedHeader?: string | null | undefined; + etagHeader?: string | null | undefined; + ttl?: number | null | undefined; + errorMessage?: string | null | undefined; + errorAt?: string | null | undefined; + ownerUserId?: string | null | undefined; + }; + subscriptionCount: number; + readCount: number; + subscription?: { + title: string | null; + userId: string; + view: number; + category: string | null; + feedId: string; + isPrivate: boolean; + } | undefined; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/feeds/refresh": { - $get: { - input: { - query: { - id: string | string[] - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + id: string | string[]; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/entries/read-histories/:id": { - $get: { - input: { - param: { - id?: string | undefined - } - } & { - query: { - page?: string | string[] | undefined - size?: string | string[] | undefined - } - } - output: { - code: 0 - data: { - users: { - [x: string]: { - name: string | null - id: string - image: string | null - handle: string | null - } - } - entryReadHistories: { - userIds: string[] - readCount: number - } | null - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + param: { + id?: string | undefined; + }; + } & { + query: { + page?: string | string[] | undefined; + size?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data: { + users: { + [x: string]: { + name: string | null; + id: string; + image: string | null; + handle: string | null; + }; + }; + entryReadHistories: { + userIds: string[]; + readCount: number; + } | null; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/entries/check-new": { - $get: { - input: { - query: { - insertedAfter: string | string[] - view?: string | string[] | undefined - feedIdList?: string | string[] | undefined - feedId?: string | string[] | undefined - read?: string | string[] | undefined - } - } - output: { - code: 0 - data: { - has_new: boolean - entry_id?: string | undefined - lastest_at?: string | undefined - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + query: { + insertedAfter: string | string[]; + view?: string | string[] | undefined; + feedIdList?: string | string[] | undefined; + feedId?: string | string[] | undefined; + read?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data: { + has_new: boolean; + entry_id?: string | undefined; + lastest_at?: string | undefined; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/entries": { - $post: { - input: { - json: { - view?: number | undefined - feedIdList?: string[] | undefined - feedId?: string | undefined - read?: boolean | undefined - limit?: number | undefined - publishedAfter?: string | undefined - publishedBefore?: string | undefined - collected?: boolean | undefined - isCollection?: boolean | undefined - isArchived?: boolean | undefined - withContent?: boolean | undefined - } - } - output: { - code: 0 - remaining: number - data?: - | { - entries: { - description: string | null - title: string | null - id: string - author: string | null - url: string | null - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - } - feeds: { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - } - read: boolean | null - collections?: - | { - createdAt: string - } - | undefined - settings?: - | { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - } - | undefined - }[] - | undefined - total?: number | undefined - } - outputFormat: "json" | "text" - status: 200 - } - $get: { - input: { - query: { - id: string | string[] - } - } - output: { - code: 0 - data?: - | { - entries: { - description: string | null - title: string | null - content: string | null - id: string - author: string | null - url: string | null - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - } - feeds: { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - } - users: { - [x: string]: { - name: string | null - id: string - image: string | null - handle: string | null - } - } - entryReadHistories: { - userIds: string[] - readCount: number - } | null - } - | undefined - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + view?: number | undefined; + feedIdList?: string[] | undefined; + feedId?: string | undefined; + read?: boolean | undefined; + limit?: number | undefined; + publishedAfter?: string | undefined; + publishedBefore?: string | undefined; + collected?: boolean | undefined; + isCollection?: boolean | undefined; + isArchived?: boolean | undefined; + withContent?: boolean | undefined; + }; + }; + output: { + code: 0; + remaining: number; + data?: { + entries: { + description: string | null; + title: string | null; + id: string; + author: string | null; + url: string | null; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; + }; + feeds: { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; + }; + read: boolean | null; + collections?: { + createdAt: string; + } | undefined; + settings?: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + } | undefined; + }[] | undefined; + total?: number | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $get: { + input: { + query: { + id: string | string[]; + }; + }; + output: { + code: 0; + data?: { + entries: { + description: string | null; + title: string | null; + content: string | null; + id: string; + author: string | null; + url: string | null; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; + }; + feeds: { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; + }; + users: { + [x: string]: { + name: string | null; + id: string; + image: string | null; + handle: string | null; + }; + }; + entryReadHistories: { + userIds: string[]; + readCount: number; + } | null; + } | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/entries/preview": { - $get: { - input: { - query: { - id: string | string[] - } - } - output: { - code: 0 - data: { - description: string | null - title: string | null - content: string | null - id: string - author: string | null - url: string | null - feedId: string - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - }[] - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + id: string | string[]; + }; + }; + output: { + code: 0; + data: { + description: string | null; + title: string | null; + content: string | null; + id: string; + author: string | null; + url: string | null; + feedId: string; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; + }[]; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/discover": { - $post: { - input: { - json: { - keyword: string - } - } - output: { - data: { - feed: { - description: string | null - title: string | null - id: string - image: string | null - url: string - siteUrl: string | null - checkedAt: string - lastModifiedHeader: string | null - etagHeader: string | null - ttl: number | null - errorMessage: string | null - errorAt: string | null - ownerUserId: string | null - owner: { - name: string | null - id: string - emailVerified: string | null - image: string | null - handle: string | null - createdAt: string - } | null - } - entries?: - | { - description: string | null - title: string | null - content: string | null - id: string - author: string | null - url: string | null - feedId: string - guid: string - authorUrl: string | null - authorAvatar: string | null - insertedAt: string - publishedAt: string - categories: string[] | null - media?: - | { - type: "photo" | "video" - url: string - width?: number | undefined - height?: number | undefined - preview_image_url?: string | undefined - }[] - | null - | undefined - attachments?: - | { - url: string - title?: string | undefined - duration_in_seconds?: number | undefined - mime_type?: string | undefined - size_in_bytes?: number | undefined - }[] - | null - | undefined - }[] - | undefined - docs?: string | undefined - isSubscribed?: boolean | undefined - subscriptionCount?: number | undefined - }[] - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: { + json: { + keyword: string; + }; + }; + output: { + data: { + feed: { + description: string | null; + title: string | null; + id: string; + image: string | null; + url: string; + siteUrl: string | null; + checkedAt: string; + lastModifiedHeader: string | null; + etagHeader: string | null; + ttl: number | null; + errorMessage: string | null; + errorAt: string | null; + ownerUserId: string | null; + owner: { + name: string | null; + id: string; + emailVerified: string | null; + image: string | null; + handle: string | null; + createdAt: string; + } | null; + }; + entries?: { + description: string | null; + title: string | null; + content: string | null; + id: string; + author: string | null; + url: string | null; + feedId: string; + guid: string; + authorUrl: string | null; + authorAvatar: string | null; + insertedAt: string; + publishedAt: string; + categories: string[] | null; + media?: { + type: "photo" | "video"; + url: string; + width?: number | undefined; + height?: number | undefined; + preview_image_url?: string | undefined; + }[] | null | undefined; + attachments?: { + url: string; + title?: string | undefined; + duration_in_seconds?: number | undefined; + mime_type?: string | undefined; + size_in_bytes?: number | undefined; + }[] | null | undefined; + }[] | undefined; + docs?: string | undefined; + isSubscribed?: boolean | undefined; + subscriptionCount?: number | undefined; + }[]; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/discover/rsshub": { - $get: { - input: { - query: { - category?: string | string[] | undefined - namespace?: string | string[] | undefined - } - } - output: { - data: { - [x: string]: { - description: string - name: string - url: string - routes: { - [x: string]: { - description: string - parameters: { - [x: string]: string - } - path: string - example: string - name: string - categories: string[] - maintainers: string[] - location: string - view?: number | undefined - } - } - } - } - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + category?: string | string[] | undefined; + namespace?: string | string[] | undefined; + }; + }; + output: { + data: { + [x: string]: { + description: string; + name: string; + url: string; + routes: { + [x: string]: { + description: string; + parameters: { + [x: string]: string; + }; + path: string; + example: string; + name: string; + categories: string[]; + maintainers: string[]; + location: string; + view?: number | undefined; + }; + }; + }; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/collections": { - $get: { - input: { - query: { - entryId: string | string[] - } - } - output: { - code: 0 - data: boolean - } - outputFormat: "json" | "text" - status: 200 - } - $post: { - input: { - json: { - entryId: string - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - $delete: { - input: { - json: { - entryId: string - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + entryId: string | string[]; + }; + }; + output: { + code: 0; + data: boolean; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $post: { + input: { + json: { + entryId: string; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $delete: { + input: { + json: { + entryId: string; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/categories": { - $get: { - input: { - query: { - view?: string | string[] | undefined - } - } - output: { - data?: string[] | undefined - } - outputFormat: "json" | "text" - status: 200 - } - $delete: { - input: { - json: { - feedIdList: string[] - deleteSubscriptions: boolean - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - $patch: { - input: { - json: { - category: string - feedIdList: string[] - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + view?: string | string[] | undefined; + }; + }; + output: { + data?: string[] | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $delete: { + input: { + json: { + feedIdList: string[]; + deleteSubscriptions: boolean; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $patch: { + input: { + json: { + category: string; + feedIdList: string[]; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/auth-app/new-session": { - $post: { - input: {} - output: { - code: 0 - data: { - userId: string - sessionToken: string - expires: string - } - } - outputFormat: "json" | "text" - status: 200 - } - } + $post: { + input: {}; + output: { + code: 0; + data: { + userId: string; + sessionToken: string; + expires: string; + }; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/auth-app/update-account": { - $patch: { - input: { - json: { - name?: string | null | undefined - image?: string | null | undefined - handle?: string | null | undefined - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $patch: { + input: { + json: { + name?: string | null | undefined; + image?: string | null | undefined; + handle?: string | null | undefined; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/ai/translation": { - $get: { - input: { - query: { - id: string | string[] - language: string | string[] - fields: string | string[] - } - } - output: { - code: 0 - data?: - | { - description?: string | undefined - title?: string | undefined - content?: string | undefined - } - | undefined - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + query: { + id: string | string[]; + language: string | string[]; + fields: string | string[]; + }; + }; + output: { + code: 0; + data?: { + description?: string | undefined; + title?: string | undefined; + content?: string | undefined; + } | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/ai/summary": { - $get: { - input: { - query: { - id: string | string[] - language?: string | string[] | undefined - } - } - output: { - code: 0 - data?: string | undefined - } - outputFormat: "json" | "text" - status: 200 - } - } + $get: { + input: { + query: { + id: string | string[]; + language?: string | string[] | undefined; + }; + }; + output: { + code: 0; + data?: string | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; "/ai/daily": { - $get: { - input: { - query: { - view: string | string[] - startDate: string | string[] - } - } - output: { - code: 0 - data: string - } - outputFormat: "json" | "text" - status: 200 - } - } - } & { + $get: { + input: { + query: { + view: string | string[]; + startDate: string | string[]; + }; + }; + output: { + code: 0; + data: string; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +} & { "/actions": { - $get: { - input: {} - output: { - code: 0 - data?: - | { - userId: string - rules?: - | { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - } - }[] - | null - | undefined - } - | undefined - } - outputFormat: "json" | "text" - status: 200 - } - $put: { - input: { - json: { - rules?: - | { - name: string - condition: { - value: string - field: "title" | "view" | "site_url" | "feed_url" | "category" - operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex" - }[] - result: { - summary?: boolean | undefined - translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined - readability?: boolean | undefined - rewriteRules?: - | { - from: string - to: string - }[] - | undefined - blockRules?: - | { - value: string | number - field: "title" | "content" | "all" | "author" | "url" | "order" - operator: - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" - }[] - | undefined - } - }[] - | null - | undefined - } - } - output: { - code: 0 - } - outputFormat: "json" | "text" - status: 200 - } - } - }, - "/" -> -type AppType = typeof _routes + $get: { + input: {}; + output: { + code: 0; + data?: { + userId: string; + rules?: { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }[] | null | undefined; + } | undefined; + }; + outputFormat: "json" | "text"; + status: 200; + }; + $put: { + input: { + json: { + rules?: { + name: string; + condition: { + value: string; + field: "title" | "view" | "site_url" | "feed_url" | "category"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[]; + result: { + summary?: boolean | undefined; + translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined; + readability?: boolean | undefined; + rewriteRules?: { + from: string; + to: string; + }[] | undefined; + blockRules?: { + value: string | number; + field: "title" | "content" | "all" | "author" | "url" | "order"; + operator: "contains" | "not_contains" | "eq" | "not_eq" | "gt" | "lt" | "regex"; + }[] | undefined; + }; + }[] | null | undefined; + }; + }; + output: { + code: 0; + }; + outputFormat: "json" | "text"; + status: 200; + }; + }; +}, "/">; +type AppType = typeof _routes; -export { - type ActionsModel, - type AppType, - type AttachmentsModel, - type EntriesModel, - type EntryReadHistoriesModel, - type FeedModel, - type MediaModel, - type SettingsModel, - accounts, - actions, - actionsItemOpenAPISchema, - actionsOpenAPISchema, - actionsRelations, - collections, - collectionsOpenAPISchema, - collectionsRelations, - entries, - entriesOpenAPISchema, - entriesRelations, - entryReadHistories, - entryReadHistoriesOpenAPISchema, - entryReadHistoriesRelations, - feedPowerTokens, - feedPowerTokensOpenAPISchema, - feedPowerTokensRelations, - feeds, - feedsInputSchema, - feedsOpenAPISchema, - feedsRelations, - invitations, - invitationsOpenAPISchema, - invitationsRelations, - languageSchema, - sessions, - settings, - subscriptions, - subscriptionsOpenAPISchema, - subscriptionsRelations, - timeline, - timelineOpenAPISchema, - timelineRelations, - transactionType, - transactions, - transactionsOpenAPISchema, - transactionsRelations, - users, - usersOpenApiSchema, - usersRelations, - verificationTokens, - wallets, - walletsOpenAPISchema, - walletsRelations, -} +export { type ActionsModel, type AppType, type AttachmentsModel, type EntriesModel, type EntryReadHistoriesModel, type FeedModel, type MediaModel, type SettingsModel, accounts, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, collections, collectionsOpenAPISchema, collectionsRelations, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsInputSchema, feedsOpenAPISchema, feedsRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, sessions, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, users, usersOpenApiSchema, usersRelations, verificationTokens, wallets, walletsOpenAPISchema, walletsRelations }; From 6fb46e7887409f735df99f7aa08cd0ef61976981 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 15 Sep 2024 21:46:04 +0800 Subject: [PATCH 49/66] fix: show filtered button only if no next page Signed-off-by: Innei --- src/renderer/src/modules/entry-column/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/modules/entry-column/index.tsx b/src/renderer/src/modules/entry-column/index.tsx index 96e0e4bcc..798bd6e90 100644 --- a/src/renderer/src/modules/entry-column/index.tsx +++ b/src/renderer/src/modules/entry-column/index.tsx @@ -210,7 +210,11 @@ function EntryColumnImpl() { ) ) : view && views[view].gridMode ? ( - + ) : ( , "data" | "endReached"> & { data: string[] endReached: () => Promise } virtuosoRef: React.RefObject + hasNextPage: boolean }) => { const masonry = useUISettingKey("pictureViewMasonry") const view = useRouteParamsSelector((s) => s.view) @@ -270,7 +276,7 @@ const ListGird = ({ const hasFilteredContent = nextData.length < virtuosoOptions.data.length - const FilteredContentTip = hasFilteredContent && ( + const FilteredContentTip = hasFilteredContent && !hasNextPage && (
    {t("entry_column.filtered_content_tip_2")}
    From 5f87190f018fea7f34c3ccbfad081fd8b855f5b8 Mon Sep 17 00:00:00 2001 From: Mokusei_Hana <117289932+Mokusei-Hana@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:20:44 +0800 Subject: [PATCH 50/66] feat(i18n): fill out and optimized partial Chinese translations (#431) Signed-off-by: Mokusei-Hana <2681173403@qq.com> --- locales/app/zh-CN.json | 4 +++- locales/settings/zh-CN.json | 34 ++++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 3f8dbef76..05f46e4a1 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -35,6 +35,8 @@ "entry_actions.tip": "打赏", "entry_actions.unstar": "取消收藏", "entry_actions.unstarred": "取消收藏", + "entry_column.filtered_content_tip": "部分内容已被过滤隐藏", + "entry_column.filtered_content_tip_2": "除了上面显示的内容外,还有一些被过滤的内容", "entry_column.refreshing": "正在刷新", "entry_content.ai_summary": "AI 总结", "entry_content.fetching_content": "正在加载...", @@ -43,7 +45,7 @@ "entry_content.no_content": "没有内容", "entry_content.readability_notice": "由 Readability 提供\n若内容或排版异常,请前往原始站点查看", "entry_content.render_error": "渲染错误:", - "entry_content.report_issue": "反馈", + "entry_content.report_issue": "反馈问题", "entry_content.web_app_notice": "网页版不支持展示该类型,请下载客户端查看", "entry_list.zero_unread": "全部已读", "entry_list_header.daily_report": "每日总结", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index f7f5aa1f0..4d9a7f784 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -73,6 +73,12 @@ "appearance.title": "外观", "appearance.ui_font": "界面字体", "appearance.unread_count": "未读数", + "feeds.claimTips": "要认证您的订阅源并接收打赏,请在订阅列表中右键点击订阅源并选择“认证”", + "feeds.noFeeds": "没有已认证的订阅源", + "feeds.tableHeaders.entryCount": "条目数", + "feeds.tableHeaders.name": "名称", + "feeds.tableHeaders.subscriptionCount": "订阅数", + "feeds.tableHeaders.tipAmount": "收到的打赏" , "general.app": "应用程序", "general.data_persist.description": "在本地保留数据以启用离线访问和本地搜索", "general.data_persist.label": "保留数据以供离线使用", @@ -83,10 +89,10 @@ "general.mark_as_read.hover.description": "鼠标悬停在条目时将自动标记为已读", "general.mark_as_read.hover.label": "悬停时标记为已读", "general.mark_as_read.render.description": "条目进入可视区域时自动标记为已读", - "general.mark_as_read.render.label": "在视口中标记为已读", - "general.mark_as_read.scroll.description": "当条目滚动出视口时自动标记为已读", + "general.mark_as_read.render.label": "在窗口中时标记为已读", + "general.mark_as_read.scroll.description": "当条目滚动出窗口时自动标记为已读", "general.mark_as_read.scroll.label": "滚动时标记为已读", - "general.privacy_data": "隐私", + "general.privacy_data": "隐私与数据", "general.rebuild_database.button": "重建", "general.rebuild_database.description": "尝试重建数据库可以解决部分渲染或其他类型问题", "general.rebuild_database.label": "重建数据库", @@ -99,7 +105,7 @@ "general.send_anonymous_data.label": "发送匿名数据", "general.show_unread_on_launch.description": "启动时显示未读内容", "general.show_unread_on_launch.label": "启动时显示未读内容", - "general.sidebar_title": "一般", + "general.sidebar_title": "通用", "general.timeline": "时间轴", "general.unread": "未读", "general.voices": "声音", @@ -180,18 +186,18 @@ "wallet.transactions.to": "接收自", "wallet.transactions.tx": "交易", "wallet.transactions.type": "类型", - "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.types.burn": "销毁", + "wallet.transactions.types.mint": "铸造", + "wallet.transactions.types.purchase": "购买", + "wallet.transactions.types.tip": "打赏", + "wallet.transactions.types.withdraw": "提现", "wallet.transactions.you": "你", "wallet.withdraw.addressLabel": "以太坊地址", "wallet.withdraw.amountLabel": "数量", - "wallet.withdraw.availableBalance": "钱包中有 个可提取的 Power", - "wallet.withdraw.button": "提取", - "wallet.withdraw.error": "提取失败:{{error}}", - "wallet.withdraw.modalTitle": "提取 Power", + "wallet.withdraw.availableBalance": "钱包中有 个可提现的 Power", + "wallet.withdraw.button": "提现", + "wallet.withdraw.error": "提现失败:{{error}}", + "wallet.withdraw.modalTitle": "提现 Power", "wallet.withdraw.submitButton": "提交", - "wallet.withdraw.success": "提取成功!" + "wallet.withdraw.success": "提现成功!" } From b3748ccfe07964c0b7c45f6e29a8225883d1dfa4 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 15 Sep 2024 23:23:33 +0800 Subject: [PATCH 51/66] feat: cache i18n resource to speed up loading time Signed-off-by: Innei --- src/renderer/src/i18n.ts | 40 +++++++++++++++++++- src/renderer/src/providers/i18n-provider.tsx | 29 ++++++++++---- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/i18n.ts b/src/renderer/src/i18n.ts index 3c541f805..409345914 100644 --- a/src/renderer/src/i18n.ts +++ b/src/renderer/src/i18n.ts @@ -5,21 +5,57 @@ import { initReactI18next } from "react-i18next" import { defaultNS, ns } from "./@types/constants" import { defaultResources } from "./@types/default-resource" +import { getGeneralSettings } from "./atoms/settings/general" import { jotaiStore } from "./lib/jotai" +import { getStorageNS } from "./lib/ns" export const i18nAtom = atom(i18next) +export class LocaleCache { + static shared = new LocaleCache() + private getKey(lang: string) { + return getStorageNS(`locale-${lang}`) + } + get(lang: string) { + const key = this.getKey(lang) + const cache = localStorage.getItem(key) + if (!cache) return null + return JSON.parse(cache) + } + set(lang: string) { + const key = this.getKey(lang) + const mergedResources = {} as any + for (const nsKey of ns) { + const nsResources = i18next.getResourceBundle(lang, nsKey) + mergedResources[nsKey] = nsResources + } + localStorage.setItem(key, JSON.stringify(mergedResources)) + } +} + export const fallbackLanguage = "en" export const initI18n = async () => { const i18next = jotaiStore.get(i18nAtom) + + const lang = getGeneralSettings().language + const cache = LocaleCache.shared.get(lang) + + const mergedResources = { + ...defaultResources, + } + + if (cache) { + mergedResources[lang] = cache + } + await i18next.use(initReactI18next).init({ ns, - lng: "en", + lng: cache ? lang : fallbackLanguage, fallbackLng: fallbackLanguage, defaultNS, debug: import.meta.env.DEV, - resources: defaultResources, + resources: mergedResources, }) } diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index ea3418b9d..60abd0e73 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -1,16 +1,16 @@ import { currentSupportedLanguages, dayjsLocaleImportMap, - defaultNS, } from "@renderer/@types/constants" import { defaultResources } from "@renderer/@types/default-resource" -import { getGeneralSettings } from "@renderer/atoms/settings/general" -import { i18nAtom } from "@renderer/i18n" +import { getGeneralSettings, setGeneralSetting } from "@renderer/atoms/settings/general" +import { fallbackLanguage, i18nAtom, LocaleCache } from "@renderer/i18n" import { EventBus } from "@renderer/lib/event-bus" import { jotaiStore } from "@renderer/lib/jotai" import { isEmptyObject } from "@renderer/lib/utils" import dayjs from "dayjs" import i18next from "i18next" +import LanguageDetector from "i18next-browser-languagedetector" import { useAtom } from "jotai" import type { FC, PropsWithChildren } from "react" import { useEffect, useLayoutEffect, useRef } from "react" @@ -18,6 +18,7 @@ import { I18nextProvider } from "react-i18next" import { toast } from "sonner" const loadingLangLock = new Set() +const loadedLangs = new Set([fallbackLanguage]) const langChangedHandler = async (lang: string) => { const dayjsImport = dayjsLocaleImportMap[lang] @@ -35,7 +36,7 @@ const langChangedHandler = async (lang: string) => { if (!isSupport) { return } - const loaded = i18next.getResourceBundle(lang, defaultNS) + const loaded = loadedLangs.has(lang) if (loaded) { return @@ -68,8 +69,8 @@ const langChangedHandler = async (lang: string) => { } } } else { - const res = await import(`/locales/${lang}.js`) - .then((res) => res?.default || res) + const res = await eval(`import('/locales/${lang}.js')`) + .then((res: any) => res?.default || res) .catch(() => { toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) loadingLangLock.delete(lang) @@ -86,10 +87,10 @@ const langChangedHandler = async (lang: string) => { await i18next.reloadResources() await i18next.changeLanguage(lang) + LocaleCache.shared.set(lang) + loadedLangs.add(lang) loadingLangLock.delete(lang) } - -langChangedHandler(getGeneralSettings().language) export const I18nProvider: FC = ({ children }) => { const [currentI18NInstance, update] = useAtom(i18nAtom) @@ -108,6 +109,18 @@ export const I18nProvider: FC = ({ children }) => { ) const callOnce = useRef(false) + const detectOnce = useRef(false) + useLayoutEffect(() => { + if (detectOnce.current) return + const languageDetector = new LanguageDetector() + const userLang = languageDetector.detect() + if (!userLang) return + const firstUserLang = Array.isArray(userLang) ? userLang[0] : userLang + if (currentSupportedLanguages.includes(firstUserLang)) { + setGeneralSetting("language", firstUserLang) + } + detectOnce.current = true + }, []) useLayoutEffect(() => { const i18next = currentI18NInstance From 7e8f462424e6b2b98b316c9814610034db93f8c9 Mon Sep 17 00:00:00 2001 From: CHANX Date: Mon, 16 Sep 2024 01:14:16 +0800 Subject: [PATCH 52/66] fix: shortcuts kbd shake (#433) --- src/renderer/src/modules/modal/shortcuts.tsx | 2 +- src/renderer/src/pages/settings/(settings)/shortcuts.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/modules/modal/shortcuts.tsx b/src/renderer/src/modules/modal/shortcuts.tsx index c6cb9e30d..877642740 100644 --- a/src/renderer/src/modules/modal/shortcuts.tsx +++ b/src/renderer/src/modules/modal/shortcuts.tsx @@ -58,7 +58,7 @@ const ShortcutModalContent = () => {
    diff --git a/src/renderer/src/pages/settings/(settings)/shortcuts.tsx b/src/renderer/src/pages/settings/(settings)/shortcuts.tsx index ca6acfb2f..1477ae5e7 100644 --- a/src/renderer/src/pages/settings/(settings)/shortcuts.tsx +++ b/src/renderer/src/pages/settings/(settings)/shortcuts.tsx @@ -28,7 +28,7 @@ export function Component() {
    From 0ccadf762bf5c761115a485ab4e68be938c527e6 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 16:19:12 +0800 Subject: [PATCH 53/66] fix(exteral): edit or follow in web app when login Signed-off-by: Innei --- .../(with-layout)/profile/[id]/index.tsx | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx index c8688332d..902633538 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx @@ -5,11 +5,12 @@ import { FollowIcon } from "@renderer/components/icons/follow" import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar" import { Button } from "@renderer/components/ui/button" import { LoadingCircle } from "@renderer/components/ui/loading" +import { useModalStack } from "@renderer/components/ui/modal" import { useAuthQuery, useI18n, useTitle } from "@renderer/hooks/common" import { apiClient } from "@renderer/lib/api-fetch" import { defineQuery } from "@renderer/lib/defineQuery" -import { stopPropagation } from "@renderer/lib/dom" import { cn } from "@renderer/lib/utils" +import { FeedForm } from "@renderer/modules/discover/feed-form" import { useUserSubscriptionsQuery } from "@renderer/modules/profile/hooks" import { DEEPLINK_SCHEME } from "@shared/constants" import { useParams } from "react-router-dom" @@ -34,6 +35,7 @@ export function Component() { useTitle(user.data?.name) const me = useWhoami() const isMe = user.data?.id === me?.id + const { present } = useModalStack() return user.isLoading ? ( @@ -78,24 +80,33 @@ export function Component() { {subscription.feeds?.description}
    - - - - + + +
    ))} From 18e4fb4b50030e2f873992839a59ac8cfdde7ff2 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 16:28:59 +0800 Subject: [PATCH 54/66] refactor: present form modal as a hook Signed-off-by: Innei --- .../src/hooks/biz/useFeedFormModal.tsx | 26 +++++++++++++++++++ .../(with-layout)/feed/[id]/index.tsx | 13 +++++++--- .../(with-layout)/profile/[id]/index.tsx | 18 +++---------- 3 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 src/renderer/src/hooks/biz/useFeedFormModal.tsx diff --git a/src/renderer/src/hooks/biz/useFeedFormModal.tsx b/src/renderer/src/hooks/biz/useFeedFormModal.tsx new file mode 100644 index 000000000..50deedfa4 --- /dev/null +++ b/src/renderer/src/hooks/biz/useFeedFormModal.tsx @@ -0,0 +1,26 @@ +import { useWhoami } from "@renderer/atoms/user" +import { useModalStack } from "@renderer/components/ui/modal" +import { FeedForm } from "@renderer/modules/discover/feed-form" +import { DEEPLINK_SCHEME } from "@shared/constants" +import { useCallback } from "react" + +import { useI18n } from "../common" + +export const usePresentFeedFormModal = () => { + const { present } = useModalStack() + const me = useWhoami() + const t = useI18n() + return useCallback( + (feedId: string) => { + if (me) { + present({ + title: t("sidebar.feed_actions.edit_feed"), + content: ({ dismiss }) => , + }) + } else { + window.location.href = `${DEEPLINK_SCHEME}add?id=${feedId}` + } + }, + [me, present, t], + ) +} diff --git a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx index 9bfaa56ea..c34c65236 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx @@ -4,6 +4,7 @@ import { Button } from "@renderer/components/ui/button" import { ListItemHoverOverlay } from "@renderer/components/ui/list-item-hover-overlay" import { LoadingCircle } from "@renderer/components/ui/loading" import { views } from "@renderer/constants" +import { usePresentFeedFormModal } from "@renderer/hooks/biz/useFeedFormModal" import { useTitle } from "@renderer/hooks/common" import { FeedViewType } from "@renderer/lib/enum" import { cn } from "@renderer/lib/utils" @@ -15,7 +16,6 @@ import { VideoItem } from "@renderer/modules/entry-column/Items/video-item" import type { UniversalItemProps } from "@renderer/modules/entry-column/types" import { useEntriesPreview } from "@renderer/queries/entries" import { useFeed } from "@renderer/queries/feed" -import { DEEPLINK_SCHEME } from "@shared/constants" import type { FC } from "react" import { useTranslation } from "react-i18next" import { useParams, useSearchParams } from "react-router-dom" @@ -60,6 +60,7 @@ export function Component() { } const { t } = useTranslation("external") useTitle(feed.data?.feed.title) + const presentFeedFormModal = usePresentFeedFormModal() return ( <> {feed.isLoading ? ( @@ -88,12 +89,16 @@ export function Component() { appName: APP_NAME, })} - - - +
    @@ -85,16 +83,8 @@ export function Component() {
    - + + {feed.data.feed.url.startsWith("https://") ? ( + + ) : ( + + )} + {feed.tipUsers?.length && ( + <> +
    + {t("entry_content.support_amount", { amount: feed.tipUsers.length })} +
    +
    + {feed.tipUsers?.map((user) => ( +
    + +
    + ))} +
    + + )} + + + )} diff --git a/src/renderer/src/modules/wallet/tip-modal.tsx b/src/renderer/src/modules/wallet/tip-modal.tsx index 938173ebe..e23d0a99c 100644 --- a/src/renderer/src/modules/wallet/tip-modal.tsx +++ b/src/renderer/src/modules/wallet/tip-modal.tsx @@ -114,7 +114,11 @@ const TipModalContent_: FC<{ {userId ? ( <>

    {t("tip_modal.feed_owner")}

    - + ) : ( <> diff --git a/src/renderer/src/store/feed/store.ts b/src/renderer/src/store/feed/store.ts index 22bcf13d5..05be579a0 100644 --- a/src/renderer/src/store/feed/store.ts +++ b/src/renderer/src/store/feed/store.ts @@ -1,12 +1,13 @@ import { whoami } from "@renderer/atoms/user" import { runTransactionInScope } from "@renderer/database" import { apiClient } from "@renderer/lib/api-fetch" -import type { FeedModel } from "@renderer/models" +import type { FeedModel, UserModel } from "@renderer/models" import { FeedService } from "@renderer/services" import { produce } from "immer" import { nanoid } from "nanoid" import { getSubscriptionByFeedId } from "../subscription" +import { userActions } from "../user" import { createZustandStore } from "../utils/helper" import type { FeedQueryParams, FeedState } from "./types" @@ -32,9 +33,19 @@ class FeedActions { feed.errorAt = null } if (feed.id) { - // Not all API return the owner, so merging is needed here. - if (state.feeds[feed.id]?.owner && !feed.owner) { - feed.owner = state.feeds[feed.id]?.owner + // Not all API return these fields, so merging is needed here. + const optionalFields = ["owner", "tipUsers"] as const + optionalFields.forEach((field) => { + if (state.feeds[feed.id!]?.[field] && !(field in feed)) { + ;(feed as any)[field] = state.feeds[feed.id!]?.[field] + } + }) + + if (feed.owner) { + userActions.upsert(feed.owner as UserModel) + } + if (feed.tipUsers) { + userActions.upsert(feed.tipUsers) } state.feeds[feed.id] = feed diff --git a/src/renderer/src/store/user/store.ts b/src/renderer/src/store/user/store.ts index abde637ca..6bcbd5ae8 100644 --- a/src/renderer/src/store/user/store.ts +++ b/src/renderer/src/store/user/store.ts @@ -17,7 +17,9 @@ class UserActions { set((state) => produce(state, (state) => { for (const u of user) { - state.users[u.id] = u + if (u?.id) { + state.users[u.id] = u + } } }), ) From 8da4fb71d9cc14832bc985cf8c1bd6f04dbe4e4c Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 16 Sep 2024 16:46:08 +0800 Subject: [PATCH 57/66] fix: userActions in feed store --- src/renderer/src/store/feed/store.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/store/feed/store.ts b/src/renderer/src/store/feed/store.ts index 05be579a0..c31cd70db 100644 --- a/src/renderer/src/store/feed/store.ts +++ b/src/renderer/src/store/feed/store.ts @@ -33,6 +33,13 @@ class FeedActions { feed.errorAt = null } if (feed.id) { + if (feed.owner) { + userActions.upsert(feed.owner as UserModel) + } + if (feed.tipUsers) { + userActions.upsert(feed.tipUsers) + } + // Not all API return these fields, so merging is needed here. const optionalFields = ["owner", "tipUsers"] as const optionalFields.forEach((field) => { @@ -41,13 +48,6 @@ class FeedActions { } }) - if (feed.owner) { - userActions.upsert(feed.owner as UserModel) - } - if (feed.tipUsers) { - userActions.upsert(feed.tipUsers) - } - state.feeds[feed.id] = feed } else { // Store temp feed in memory From aff559a9ddd2a3a5c9235c8e5b0ab521a73d5db0 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 16:51:13 +0800 Subject: [PATCH 58/66] fix: header icon size Signed-off-by: Innei --- src/renderer/src/components/header.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/header.tsx b/src/renderer/src/components/header.tsx index 2cf4f55f9..56f8904ea 100644 --- a/src/renderer/src/components/header.tsx +++ b/src/renderer/src/components/header.tsx @@ -42,7 +42,11 @@ export function Header() {
    - } label={t("header.app")} /> + } + label={t("header.app")} + /> - {cloneElement(icon, { className: `size-3 ${icon.props.className}` })} + + {cloneElement(icon, { className: `size-4 ${icon.props.className}` })} + {label} From 18e26a41c3cf80316bc97c44a1239e6ec45c5db9 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 16:53:15 +0800 Subject: [PATCH 59/66] fix(item): center content if no desc Signed-off-by: Innei --- .../(with-layout)/profile/[id]/index.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx index 96297d069..e6d06fd0e 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/profile/[id]/index.tsx @@ -70,13 +70,20 @@ export function Component() { target="_blank" > -
    +
    {subscription.feeds?.title}
    -
    - {subscription.feeds?.description} -
    + {subscription.feeds?.description && ( +
    + {subscription.feeds.description} +
    + )}
    From 7f994d7a21080468cb07908b4b8fc694ebfeba37 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 16 Sep 2024 16:56:06 +0800 Subject: [PATCH 60/66] fix: zero tipUsers --- src/renderer/src/modules/entry-content/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index 3287e5c74..b0dfb9345 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -304,7 +304,7 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl <> -
    +
    = ({ entryId, cl {t("entry_content.support_creator")} - {feed.tipUsers?.length && ( + {!!feed.tipUsers?.length && ( <>
    {t("entry_content.support_amount", { amount: feed.tipUsers.length })} From e31e3433dfdafcab2276f2794065af81ca1f75fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Deng=20=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Mon, 16 Sep 2024 16:59:43 +0800 Subject: [PATCH 61/66] fix: correct follower word (#438) --- locales/external/en.json | 4 ++-- locales/external/fr.json | 4 ++-- locales/external/ja.json | 4 ++-- locales/external/pt.json | 4 ++-- locales/external/zh-CN.json | 4 ++-- locales/external/zh-TW.json | 4 ++-- .../src/pages/(external)/(with-layout)/feed/[id]/index.tsx | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locales/external/en.json b/locales/external/en.json index b8e993a8e..30fa264e2 100644 --- a/locales/external/en.json +++ b/locales/external/en.json @@ -1,8 +1,8 @@ { "copied_link": "Copied link to clipboard", "feed": { - "follow_one": "follow", - "follow_other": "follows", + "follower_one": "follower", + "follower_other": "followers", "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} with {{readCount}} {{readNoun}} on {{appName}}", "read_one": "read", "read_other": "reads" diff --git a/locales/external/fr.json b/locales/external/fr.json index e790d966a..b8ea48ffa 100644 --- a/locales/external/fr.json +++ b/locales/external/fr.json @@ -1,7 +1,7 @@ { "feed": { - "follow_one": "suivi", - "follow_other": "suivis", + "follower_one": "suivi", + "follower_other": "suivis", "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} avec {{readCount}} {{readNoun}} sur {{appName}}", "read_one": "lecture", "read_other": "lectures" diff --git a/locales/external/ja.json b/locales/external/ja.json index efa0f30ba..c18a56a64 100644 --- a/locales/external/ja.json +++ b/locales/external/ja.json @@ -1,7 +1,7 @@ { "feed": { - "follow_one": "フォロー", - "follow_other": "フォロー", + "follower_one": "フォロー", + "follower_other": "フォロー", "followsAndReads": "{{appName}} で {{subscriptionCount}} {{subscriptionNoun}} と {{readCount}} {{readNoun}}", "read_one": "読んだ", "read_other": "既読" diff --git a/locales/external/pt.json b/locales/external/pt.json index a1bf83f35..4613d598a 100644 --- a/locales/external/pt.json +++ b/locales/external/pt.json @@ -1,7 +1,7 @@ { "feed": { - "follow_one": "seguir", - "follow_other": "seguimentos", + "follower_one": "seguir", + "follower_other": "seguimentos", "followsAndReads": "{{subscriptionCount}} {{subscriptionNoun}} com {{readCount}} {{readNoun}} no {{appName}}", "read_one": "leitura", "read_other": "leituras" diff --git a/locales/external/zh-CN.json b/locales/external/zh-CN.json index d1f5ca67f..913e8c2f3 100644 --- a/locales/external/zh-CN.json +++ b/locales/external/zh-CN.json @@ -1,7 +1,7 @@ { "feed": { - "follow_one": "关注者", - "follow_other": "关注者", + "follower_one": "关注者", + "follower_other": "关注者", "followsAndReads": "在 {{appName}} 上有 {{subscriptionCount}} 个{{subscriptionNoun}},{{readCount}} 篇{{readNoun}}", "read_one": "文章", "read_other": "文章" diff --git a/locales/external/zh-TW.json b/locales/external/zh-TW.json index 64b69502a..0f49ca6c0 100644 --- a/locales/external/zh-TW.json +++ b/locales/external/zh-TW.json @@ -1,7 +1,7 @@ { "feed": { - "follow_one": "追蹤", - "follow_other": "追蹤數", + "follower_one": "追隨者", + "follower_other": "追隨者", "followsAndReads": "{{subscriptionCount}} 個 {{subscriptionNoun}} 和 {{readCount}} 個 {{readNoun}} 在 {{appName}}", "read_one": "閱讀", "read_other": "閱讀數" diff --git a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx index 559bbc31c..c44c83ad4 100644 --- a/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx +++ b/src/renderer/src/pages/(external)/(with-layout)/feed/[id]/index.tsx @@ -84,7 +84,7 @@ export function Component() {
    {t("feed.followsAndReads", { subscriptionCount: feed.data.subscriptionCount, - subscriptionNoun: t("feed.follow", { count: feed.data.subscriptionCount }), + subscriptionNoun: t("feed.follower", { count: feed.data.subscriptionCount }), readCount: feed.data.readCount, readNoun: t("feed.read", { count: feed.data.readCount }), appName: APP_NAME, From 6b1009ecfde47d68859a202a2be8a1cde901f2fc Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 17:09:13 +0800 Subject: [PATCH 62/66] fix: format time locale fallback Signed-off-by: Innei --- src/renderer/src/components/ui/datetime/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/ui/datetime/index.tsx b/src/renderer/src/components/ui/datetime/index.tsx index 780ca9dec..17593368c 100644 --- a/src/renderer/src/components/ui/datetime/index.tsx +++ b/src/renderer/src/components/ui/datetime/index.tsx @@ -104,7 +104,14 @@ export const RelativeDay = ({ date }: { date: Date }) => { } else if (diffDays === 1) { return t("time.yesterday") } else { - return date.toLocaleDateString(new Intl.Locale(language), { + let locale: Intl.Locale + + try { + locale = new Intl.Locale(language.replace("_", "-")) + } catch { + locale = new Intl.Locale("en-US") + } + return date.toLocaleDateString(locale, { weekday: "long", month: "short", day: "numeric", From b9c6a8b58099c86a178494ffe4c875f7c31760a3 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 17:20:24 +0800 Subject: [PATCH 63/66] feat: add manual setting lang lock keyu Signed-off-by: Innei --- src/renderer/src/constants/app.tsx | 3 ++ .../src/modules/settings/tabs/general.tsx | 2 ++ src/renderer/src/providers/i18n-provider.tsx | 30 +++++++++---------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/constants/app.tsx b/src/renderer/src/constants/app.tsx index 341eee264..188a3b946 100644 --- a/src/renderer/src/constants/app.tsx +++ b/src/renderer/src/constants/app.tsx @@ -12,3 +12,6 @@ export const ROUTE_FEED_IN_FOLDER = "folder-" export const DAILY_CLAIM_AMOUNT = "20" export const INVITATION_PRICE = "100" + +// NS key +export const IS_MANUAL_CHANGE_LANGUAGE_KEY = getStorageNS("isManualChangeLanguage") diff --git a/src/renderer/src/modules/settings/tabs/general.tsx b/src/renderer/src/modules/settings/tabs/general.tsx index de7ed2e76..66132dbeb 100644 --- a/src/renderer/src/modules/settings/tabs/general.tsx +++ b/src/renderer/src/modules/settings/tabs/general.tsx @@ -19,6 +19,7 @@ import { SelectTrigger, SelectValue, } from "@renderer/components/ui/select" +import { IS_MANUAL_CHANGE_LANGUAGE_KEY } from "@renderer/constants" import { fallbackLanguage } from "@renderer/i18n" import { initPostHog } from "@renderer/initialize/posthog" import { tipcClient } from "@renderer/lib/client" @@ -213,6 +214,7 @@ export const LanguageSelector = () => { defaultValue={finalRenderLanguage} value={finalRenderLanguage} onValueChange={(value) => { + localStorage.setItem(IS_MANUAL_CHANGE_LANGUAGE_KEY, "true") setGeneralSetting("language", value as string) i18n.changeLanguage(value as string) }} diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index 60abd0e73..0061f2523 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -1,9 +1,7 @@ -import { - currentSupportedLanguages, - dayjsLocaleImportMap, -} from "@renderer/@types/constants" +import { currentSupportedLanguages, dayjsLocaleImportMap } from "@renderer/@types/constants" import { defaultResources } from "@renderer/@types/default-resource" import { getGeneralSettings, setGeneralSetting } from "@renderer/atoms/settings/general" +import { IS_MANUAL_CHANGE_LANGUAGE_KEY } from "@renderer/constants" import { fallbackLanguage, i18nAtom, LocaleCache } from "@renderer/i18n" import { EventBus } from "@renderer/lib/event-bus" import { jotaiStore } from "@renderer/lib/jotai" @@ -110,17 +108,6 @@ export const I18nProvider: FC = ({ children }) => { const callOnce = useRef(false) const detectOnce = useRef(false) - useLayoutEffect(() => { - if (detectOnce.current) return - const languageDetector = new LanguageDetector() - const userLang = languageDetector.detect() - if (!userLang) return - const firstUserLang = Array.isArray(userLang) ? userLang[0] : userLang - if (currentSupportedLanguages.includes(firstUserLang)) { - setGeneralSetting("language", firstUserLang) - } - detectOnce.current = true - }, []) useLayoutEffect(() => { const i18next = currentI18NInstance @@ -132,6 +119,19 @@ export const I18nProvider: FC = ({ children }) => { } }, [currentI18NInstance]) + useLayoutEffect(() => { + if (localStorage.getItem(IS_MANUAL_CHANGE_LANGUAGE_KEY)) return + if (detectOnce.current) return + const languageDetector = new LanguageDetector() + const userLang = languageDetector.detect() + if (!userLang) return + const firstUserLang = Array.isArray(userLang) ? userLang[0] : userLang + if (currentSupportedLanguages.includes(firstUserLang)) { + setGeneralSetting("language", firstUserLang) + } + detectOnce.current = true + }, []) + useLayoutEffect(() => { if (callOnce.current) return const { language } = getGeneralSettings() From bbe4ea66e75a8911e9ef39764d02d22251ba743e Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 17:25:06 +0800 Subject: [PATCH 64/66] fix: wait language load then switch to target language Signed-off-by: Innei --- locales/settings/zh-CN.json | 4 +- src/renderer/src/lib/load-language.ts | 83 ++++++++++++++++++ .../src/modules/settings/tabs/general.tsx | 10 ++- src/renderer/src/providers/i18n-provider.tsx | 86 +------------------ 4 files changed, 96 insertions(+), 87 deletions(-) create mode 100644 src/renderer/src/lib/load-language.ts diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 4d9a7f784..be9372bb5 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -78,7 +78,7 @@ "feeds.tableHeaders.entryCount": "条目数", "feeds.tableHeaders.name": "名称", "feeds.tableHeaders.subscriptionCount": "订阅数", - "feeds.tableHeaders.tipAmount": "收到的打赏" , + "feeds.tableHeaders.tipAmount": "收到的打赏", "general.app": "应用程序", "general.data_persist.description": "在本地保留数据以启用离线访问和本地搜索", "general.data_persist.label": "保留数据以供离线使用", @@ -159,7 +159,7 @@ "titles.about": "关于", "titles.actions": "自动化", "titles.appearance": "外观", - "titles.general": "常规", + "titles.general": "通用", "titles.integration": "集成", "titles.invitations": "邀请", "titles.power": "Power", diff --git a/src/renderer/src/lib/load-language.ts b/src/renderer/src/lib/load-language.ts new file mode 100644 index 000000000..fd4b98bb2 --- /dev/null +++ b/src/renderer/src/lib/load-language.ts @@ -0,0 +1,83 @@ +import { currentSupportedLanguages, dayjsLocaleImportMap } from "@renderer/@types/constants" +import { defaultResources } from "@renderer/@types/default-resource" +import { fallbackLanguage, i18nAtom, LocaleCache } from "@renderer/i18n" +import { jotaiStore } from "@renderer/lib/jotai" +import { isEmptyObject } from "@renderer/lib/utils" +import dayjs from "dayjs" +import i18next from "i18next" +import { toast } from "sonner" + +const loadingLangLock = new Set() +const loadedLangs = new Set([fallbackLanguage]) + +export const loadLanguageAndApply = async (lang: string) => { + const dayjsImport = dayjsLocaleImportMap[lang] + + if (dayjsImport) { + const [locale, loader] = dayjsImport + loader().then(() => { + dayjs.locale(locale) + }) + } + + const { t } = jotaiStore.get(i18nAtom) + if (loadingLangLock.has(lang)) return + const isSupport = currentSupportedLanguages.includes(lang) + if (!isSupport) { + return + } + const loaded = loadedLangs.has(lang) + + if (loaded) { + return + } + + loadingLangLock.add(lang) + + if (import.meta.env.DEV) { + const nsGlobbyMap = import.meta.glob("@locales/*/*.json") + + const namespaces = Object.keys(defaultResources.en) + + const res = await Promise.allSettled( + namespaces.map(async (ns) => { + const loader = nsGlobbyMap[`../../locales/${ns}/${lang}.json`] + + if (!loader) return + const nsResources = await loader().then((m: any) => m.default) + + i18next.addResourceBundle(lang, ns, nsResources, true, true) + }), + ) + + for (const r of res) { + if (r.status === "rejected") { + toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) + loadingLangLock.delete(lang) + + return + } + } + } else { + const res = await eval(`import('/locales/${lang}.js')`) + .then((res: any) => res?.default || res) + .catch(() => { + toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) + loadingLangLock.delete(lang) + return {} + }) + + if (isEmptyObject(res)) { + return + } + for (const namespace in res) { + i18next.addResourceBundle(lang, namespace, res[namespace], true, true) + } + } + + await i18next.reloadResources() + await i18next.changeLanguage(lang) + LocaleCache.shared.set(lang) + loadedLangs.add(lang) + loadingLangLock.delete(lang) +} diff --git a/src/renderer/src/modules/settings/tabs/general.tsx b/src/renderer/src/modules/settings/tabs/general.tsx index 66132dbeb..b27e48804 100644 --- a/src/renderer/src/modules/settings/tabs/general.tsx +++ b/src/renderer/src/modules/settings/tabs/general.tsx @@ -23,8 +23,10 @@ import { IS_MANUAL_CHANGE_LANGUAGE_KEY } from "@renderer/constants" import { fallbackLanguage } from "@renderer/i18n" import { initPostHog } from "@renderer/initialize/posthog" import { tipcClient } from "@renderer/lib/client" +import { loadLanguageAndApply } from "@renderer/lib/load-language" import { clearLocalPersistStoreData } from "@renderer/store/utils/clear" import { useQuery } from "@tanstack/react-query" +import i18next from "i18next" import { useCallback, useEffect } from "react" import { useTranslation } from "react-i18next" @@ -200,7 +202,7 @@ export const VoiceSelector = () => { } export const LanguageSelector = () => { - const { t, i18n } = useTranslation("settings") + const { t } = useTranslation("settings") const { t: langT } = useTranslation("lang") const language = useGeneralSettingSelector((state) => state.language) @@ -215,8 +217,10 @@ export const LanguageSelector = () => { value={finalRenderLanguage} onValueChange={(value) => { localStorage.setItem(IS_MANUAL_CHANGE_LANGUAGE_KEY, "true") - setGeneralSetting("language", value as string) - i18n.changeLanguage(value as string) + loadLanguageAndApply(value as string).then(() => { + i18next.changeLanguage(value as string) + setGeneralSetting("language", value as string) + }) }} > diff --git a/src/renderer/src/providers/i18n-provider.tsx b/src/renderer/src/providers/i18n-provider.tsx index 0061f2523..c833072d9 100644 --- a/src/renderer/src/providers/i18n-provider.tsx +++ b/src/renderer/src/providers/i18n-provider.tsx @@ -1,94 +1,16 @@ -import { currentSupportedLanguages, dayjsLocaleImportMap } from "@renderer/@types/constants" -import { defaultResources } from "@renderer/@types/default-resource" +import { currentSupportedLanguages } from "@renderer/@types/constants" import { getGeneralSettings, setGeneralSetting } from "@renderer/atoms/settings/general" import { IS_MANUAL_CHANGE_LANGUAGE_KEY } from "@renderer/constants" -import { fallbackLanguage, i18nAtom, LocaleCache } from "@renderer/i18n" +import { i18nAtom } from "@renderer/i18n" import { EventBus } from "@renderer/lib/event-bus" -import { jotaiStore } from "@renderer/lib/jotai" -import { isEmptyObject } from "@renderer/lib/utils" -import dayjs from "dayjs" +import { loadLanguageAndApply } from "@renderer/lib/load-language" import i18next from "i18next" import LanguageDetector from "i18next-browser-languagedetector" import { useAtom } from "jotai" import type { FC, PropsWithChildren } from "react" import { useEffect, useLayoutEffect, useRef } from "react" import { I18nextProvider } from "react-i18next" -import { toast } from "sonner" -const loadingLangLock = new Set() -const loadedLangs = new Set([fallbackLanguage]) - -const langChangedHandler = async (lang: string) => { - const dayjsImport = dayjsLocaleImportMap[lang] - - if (dayjsImport) { - const [locale, loader] = dayjsImport - loader().then(() => { - dayjs.locale(locale) - }) - } - - const { t } = jotaiStore.get(i18nAtom) - if (loadingLangLock.has(lang)) return - const isSupport = currentSupportedLanguages.includes(lang) - if (!isSupport) { - return - } - const loaded = loadedLangs.has(lang) - - if (loaded) { - return - } - - loadingLangLock.add(lang) - - if (import.meta.env.DEV) { - const nsGlobbyMap = import.meta.glob("@locales/*/*.json") - - const namespaces = Object.keys(defaultResources.en) - - const res = await Promise.allSettled( - namespaces.map(async (ns) => { - const loader = nsGlobbyMap[`../../locales/${ns}/${lang}.json`] - - if (!loader) return - const nsResources = await loader().then((m: any) => m.default) - - i18next.addResourceBundle(lang, ns, nsResources, true, true) - }), - ) - - for (const r of res) { - if (r.status === "rejected") { - toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) - loadingLangLock.delete(lang) - - return - } - } - } else { - const res = await eval(`import('/locales/${lang}.js')`) - .then((res: any) => res?.default || res) - .catch(() => { - toast.error(`${t("common:tips.load-lng-error")}: ${lang}`) - loadingLangLock.delete(lang) - return {} - }) - - if (isEmptyObject(res)) { - return - } - for (const namespace in res) { - i18next.addResourceBundle(lang, namespace, res[namespace], true, true) - } - } - - await i18next.reloadResources() - await i18next.changeLanguage(lang) - LocaleCache.shared.set(lang) - loadedLangs.add(lang) - loadingLangLock.delete(lang) -} export const I18nProvider: FC = ({ children }) => { const [currentI18NInstance, update] = useAtom(i18nAtom) @@ -112,7 +34,7 @@ export const I18nProvider: FC = ({ children }) => { useLayoutEffect(() => { const i18next = currentI18NInstance - i18next.on("languageChanged", langChangedHandler) + i18next.on("languageChanged", loadLanguageAndApply) return () => { i18next.off("languageChanged") From 2d14c1e5b5ad086b3556dd9a8862a6ce00368c4d Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 16 Sep 2024 17:30:47 +0800 Subject: [PATCH 65/66] fix: add language selector loading lock map Signed-off-by: Innei --- .../src/modules/settings/tabs/general.tsx | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/modules/settings/tabs/general.tsx b/src/renderer/src/modules/settings/tabs/general.tsx index b27e48804..e1045a6ea 100644 --- a/src/renderer/src/modules/settings/tabs/general.tsx +++ b/src/renderer/src/modules/settings/tabs/general.tsx @@ -11,6 +11,7 @@ import { useUISettingSelector, } from "@renderer/atoms/settings/ui" import { Button } from "@renderer/components/ui/button" +import { LoadingCircle } from "@renderer/components/ui/loading" import { useModalStack } from "@renderer/components/ui/modal" import { Select, @@ -24,10 +25,11 @@ import { fallbackLanguage } from "@renderer/i18n" import { initPostHog } from "@renderer/initialize/posthog" import { tipcClient } from "@renderer/lib/client" import { loadLanguageAndApply } from "@renderer/lib/load-language" +import { cn } from "@renderer/lib/utils" import { clearLocalPersistStoreData } from "@renderer/store/utils/clear" import { useQuery } from "@tanstack/react-query" import i18next from "i18next" -import { useCallback, useEffect } from "react" +import { useCallback, useEffect, useState } from "react" import { useTranslation } from "react-i18next" import { SettingsTitle } from "../title" @@ -209,22 +211,37 @@ export const LanguageSelector = () => { const finalRenderLanguage = currentSupportedLanguages.includes(language) ? language : fallbackLanguage + + const [loadingLanguageLockMap, setLoadingLanguageLockMap] = useState( + {} as Record, + ) return (
    {t("general.language")}