From e7728a3d34fa74be42e91dcc3c87d228ade1b13e Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Thu, 10 Apr 2025 16:22:46 +0800 Subject: [PATCH] refactor: unify unread count locales and logic (#3453) --- .../src/modules/settings/tabs/apperance.tsx | 6 ++-- .../src/components/ui/grouped/GroupedList.tsx | 2 +- apps/mobile/src/initialize/background.ts | 4 ++- apps/mobile/src/lib/permission.ts | 17 +++++++++- .../modules/screen/TimelineViewSelector.tsx | 11 ++++-- .../modules/settings/routes/Appearance.tsx | 34 ++++++++++++++----- .../modules/subscription/CategoryGrouped.tsx | 5 ++- .../subscription/items/UnreadCount.tsx | 32 ++++++++++++++--- apps/mobile/src/store/unread/store.ts | 5 --- locales/settings/ar-DZ.json | 6 ++-- locales/settings/ar-IQ.json | 6 ++-- locales/settings/ar-KW.json | 6 ++-- locales/settings/ar-MA.json | 6 ++-- locales/settings/ar-SA.json | 6 ++-- locales/settings/ar-TN.json | 6 ++-- locales/settings/de.json | 6 ++-- locales/settings/en.json | 8 ++--- locales/settings/es.json | 6 ++-- locales/settings/fi.json | 6 ++-- locales/settings/fr.json | 6 ++-- locales/settings/it.json | 6 ++-- locales/settings/ja.json | 6 ++-- locales/settings/ko.json | 6 ++-- locales/settings/pt.json | 6 ++-- locales/settings/ru.json | 6 ++-- locales/settings/tr.json | 6 ++-- locales/settings/zh-CN.json | 8 ++--- locales/settings/zh-HK.json | 6 ++-- locales/settings/zh-TW.json | 6 ++-- packages/shared/src/settings/defaults.ts | 3 +- packages/shared/src/settings/interface.ts | 3 +- 31 files changed, 150 insertions(+), 96 deletions(-) diff --git a/apps/desktop/src/renderer/src/modules/settings/tabs/apperance.tsx b/apps/desktop/src/renderer/src/modules/settings/tabs/apperance.tsx index 8a258b5df..c6d267c54 100644 --- a/apps/desktop/src/renderer/src/modules/settings/tabs/apperance.tsx +++ b/apps/desktop/src/renderer/src/modules/settings/tabs/apperance.tsx @@ -71,16 +71,16 @@ export const SettingAppearance = () => { { type: "title", - value: t("appearance.unread_count"), + value: t("appearance.unread_count.label"), }, defineItem("showDockBadge", { - label: t("appearance.show_dock_badge.label"), + label: t("appearance.unread_count.badge.label"), hide: !IN_ELECTRON || !["macOS", "Linux"].includes(getOS()) || isMobile, }), defineItem("sidebarShowUnreadCount", { - label: t("appearance.sidebar_show_unread_count.label"), + label: t("appearance.unread_count.view_and_subscription.label"), }), { diff --git a/apps/mobile/src/components/ui/grouped/GroupedList.tsx b/apps/mobile/src/components/ui/grouped/GroupedList.tsx index 11eb2d595..0a1d12ce1 100644 --- a/apps/mobile/src/components/ui/grouped/GroupedList.tsx +++ b/apps/mobile/src/components/ui/grouped/GroupedList.tsx @@ -182,7 +182,7 @@ export const GroupedInsetListCell: FC< > = ({ label, description, children, leftClassName, rightClassName }) => { return ( - + {label} {!!description && ( {description} diff --git a/apps/mobile/src/initialize/background.ts b/apps/mobile/src/initialize/background.ts index 351012fae..fc3ffe6b7 100644 --- a/apps/mobile/src/initialize/background.ts +++ b/apps/mobile/src/initialize/background.ts @@ -1,6 +1,7 @@ import * as BackgroundFetch from "expo-background-fetch" import * as TaskManager from "expo-task-manager" +import { getUISettings } from "../atoms/settings/ui" import { unreadSyncService } from "../store/unread/store" import { whoami } from "../store/user/getters" @@ -11,7 +12,8 @@ export async function initBackgroundFetch() { // const now = Date.now() // console.log(`Got background fetch call at date: ${new Date(now).toISOString()}`) const user = whoami() - if (!user) { + const { showUnreadCountBadgeMobile } = getUISettings() + if (!user || !showUnreadCountBadgeMobile) { return BackgroundFetch.BackgroundFetchResult.NoData } diff --git a/apps/mobile/src/lib/permission.ts b/apps/mobile/src/lib/permission.ts index 6a8be4940..88a64bd75 100644 --- a/apps/mobile/src/lib/permission.ts +++ b/apps/mobile/src/lib/permission.ts @@ -1,6 +1,7 @@ import * as Notifications from "expo-notifications" import { Platform } from "react-native" +import { getUISettings } from "../atoms/settings/ui" import { toast } from "./toast" export async function requestNotificationPermission() { @@ -26,10 +27,24 @@ export async function requestNotificationPermission() { return true } -export async function setBadgeCountAsyncWithPermission(badgeCount: number) { +export async function setBadgeCountAsyncWithPermission( + badgeCount: number, + skipSettingCheck = false, +) { + const { showUnreadCountBadgeMobile } = getUISettings() + if (!showUnreadCountBadgeMobile && !skipSettingCheck) { + return false + } + const permissionGranted = await requestNotificationPermission() if (!permissionGranted) { return false } + + const currentBadgeCount = await Notifications.getBadgeCountAsync() + if (badgeCount === currentBadgeCount) { + return false + } + return await Notifications.setBadgeCountAsync(badgeCount) } diff --git a/apps/mobile/src/modules/screen/TimelineViewSelector.tsx b/apps/mobile/src/modules/screen/TimelineViewSelector.tsx index 34c0ba03d..9f5942b93 100644 --- a/apps/mobile/src/modules/screen/TimelineViewSelector.tsx +++ b/apps/mobile/src/modules/screen/TimelineViewSelector.tsx @@ -19,6 +19,7 @@ import { useViewWithSubscription } from "@/src/store/subscription/hooks" import { useUnreadCountByView } from "@/src/store/unread/hooks" import { useColor } from "@/src/theme/colors" +import { UnreadCount } from "../subscription/items/UnreadCount" import { TimelineViewSelectorContextMenu } from "./TimelineViewSelectorContextMenu" const ACTIVE_WIDTH = 180 @@ -164,9 +165,13 @@ function ViewItem({ > {t(view.name)} - {!!unreadCount && ( - - )} + ) : ( !!unreadCount && diff --git a/apps/mobile/src/modules/settings/routes/Appearance.tsx b/apps/mobile/src/modules/settings/routes/Appearance.tsx index 937898936..525382203 100644 --- a/apps/mobile/src/modules/settings/routes/Appearance.tsx +++ b/apps/mobile/src/modules/settings/routes/Appearance.tsx @@ -14,10 +14,15 @@ import { GroupedInsetListSectionHeader, } from "@/src/components/ui/grouped/GroupedList" import { Switch } from "@/src/components/ui/switch/Switch" +import { setBadgeCountAsyncWithPermission } from "@/src/lib/permission" +import { getAllUnreadCount } from "@/src/store/unread/getter" export const AppearanceScreen = () => { const { t } = useTranslation("settings") - const showUnreadCount = useUISettingKey("subscriptionShowUnreadCount") + const showUnreadCountViewAndSubscriptionMobile = useUISettingKey( + "showUnreadCountViewAndSubscriptionMobile", + ) + const showUnreadCountBadgeMobile = useUISettingKey("showUnreadCountBadgeMobile") const hideExtraBadge = useUISettingKey("hideExtraBadge") const thumbnailRatio = useUISettingKey("thumbnailRatio") @@ -33,21 +38,34 @@ export const AppearanceScreen = () => { className="bg-system-grouped-background" Header={} > - + - + { - setUISetting("subscriptionShowUnreadCount", val) + setUISetting("showUnreadCountBadgeMobile", val) + setBadgeCountAsyncWithPermission(val ? getAllUnreadCount() : 0, true) }} /> + + { + setUISetting("showUnreadCountViewAndSubscriptionMobile", val) + }} + /> + + + + {category} - {!!unreadCounts && ( - {unreadCounts} - )} + diff --git a/apps/mobile/src/modules/subscription/items/UnreadCount.tsx b/apps/mobile/src/modules/subscription/items/UnreadCount.tsx index c557bd7b7..e8919bae6 100644 --- a/apps/mobile/src/modules/subscription/items/UnreadCount.tsx +++ b/apps/mobile/src/modules/subscription/items/UnreadCount.tsx @@ -1,15 +1,37 @@ import { cn } from "@follow/utils" -import { Text, View } from "react-native" +import type { AnimatedProps } from "react-native-reanimated" +import Animated from "react-native-reanimated" import { useUISettingKey } from "@/src/atoms/settings/ui" -export function UnreadCount({ unread, className }: { unread?: number; className?: string }) { - const showUnreadCount = useUISettingKey("subscriptionShowUnreadCount") +export function UnreadCount({ + unread, + className, + textClassName, + dotClassName, + max = Infinity, + ...rest +}: { + unread?: number + className?: string + textClassName?: string + dotClassName?: string + max?: number +} & AnimatedProps) { + const showUnreadCount = useUISettingKey("showUnreadCountViewAndSubscriptionMobile") if (!unread) return null return showUnreadCount ? ( - {unread} + + {unread > max ? `${max}+` : unread} + ) : ( - + ) } diff --git a/apps/mobile/src/store/unread/store.ts b/apps/mobile/src/store/unread/store.ts index 07412f657..c8f9ae5bb 100644 --- a/apps/mobile/src/store/unread/store.ts +++ b/apps/mobile/src/store/unread/store.ts @@ -1,5 +1,4 @@ import type { FeedViewType } from "@follow/constants" -import * as Notifications from "expo-notifications" import type { UnreadSchema } from "@/src/database/schemas/types" import { apiClient } from "@/src/lib/api-fetch" @@ -37,10 +36,6 @@ class UnreadSyncService { async updateBadgeAtBackground() { await this.fetch() const allUnreadCount = getAllUnreadCount() - const currentBadgeCount = await Notifications.getBadgeCountAsync() - if (allUnreadCount === currentBadgeCount) { - return false - } setBadgeCountAsyncWithPermission(allUnreadCount) return true } diff --git a/locales/settings/ar-DZ.json b/locales/settings/ar-DZ.json index bad456b23..ff2b895a0 100644 --- a/locales/settings/ar-DZ.json +++ b/locales/settings/ar-DZ.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "نظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد غير المقروء", + "appearance.unread_count.badge.label": "عرض كشارة Dock", + "appearance.unread_count.label": "عدد غير المقروء", + "appearance.unread_count.view_and_subscription.label": "عرض في الشريط الجانبي", "general.app": "التطبيق", "general.data_persist.description": "حفظ البيانات محليًا لتمكين الوصول دون اتصال والبحث المحلي.", "general.data_persist.label": "حفظ البيانات للاستخدام دون اتصال", diff --git a/locales/settings/ar-IQ.json b/locales/settings/ar-IQ.json index 97e22fc1b..6317ac402 100644 --- a/locales/settings/ar-IQ.json +++ b/locales/settings/ar-IQ.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "نظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد غير المقروء", + "appearance.unread_count.badge.label": "عرض كشارة Dock", + "appearance.unread_count.label": "عدد غير المقروء", + "appearance.unread_count.view_and_subscription.label": "عرض في الشريط الجانبي", "feeds.claimTips": "لمطالبة بتغذياتك واستلام الإكراميات، انقر بزر الماوس الأيمن على التغذية في قائمة اشتراكاتك واختر مطالبة.", "feeds.noFeeds": "لا توجد تغذيات مطالبة", "feeds.tableHeaders.name": "الاسم", diff --git a/locales/settings/ar-KW.json b/locales/settings/ar-KW.json index a04bf2bdb..7b7ea8dd4 100644 --- a/locales/settings/ar-KW.json +++ b/locales/settings/ar-KW.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "نظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد غير المقروء", + "appearance.unread_count.badge.label": "عرض كشارة Dock", + "appearance.unread_count.label": "عدد غير المقروء", + "appearance.unread_count.view_and_subscription.label": "عرض في الشريط الجانبي", "feeds.claimTips": "للمطالبة بتغذياتك والحصول على نصائح، انقر بزر الماوس الأيمن على التغذية في قائمة الاشتراكات واختر المطالبة.", "feeds.noFeeds": "لا توجد تغذيات مملوكة", "feeds.tableHeaders.name": "الاسم", diff --git a/locales/settings/ar-MA.json b/locales/settings/ar-MA.json index dbfaa3a34..5bb6d8a60 100644 --- a/locales/settings/ar-MA.json +++ b/locales/settings/ar-MA.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "نظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد غير المقروء", + "appearance.unread_count.badge.label": "عرض كشارة Dock", + "appearance.unread_count.label": "عدد غير المقروء", + "appearance.unread_count.view_and_subscription.label": "عرض فالشريط الجانبي", "general.app": "التطبيق", "general.data_persist.description": "حفظ البيانات محليًا باش تمكن الوصول بلا إنترنت والبحث المحلي.", "general.data_persist.label": "حفظ البيانات للاستخدام بلا إنترنت", diff --git a/locales/settings/ar-SA.json b/locales/settings/ar-SA.json index 1c5efe595..99f63aa13 100644 --- a/locales/settings/ar-SA.json +++ b/locales/settings/ar-SA.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "النظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد غير المقروء", + "appearance.unread_count.badge.label": "عرض كشارة على Dock", + "appearance.unread_count.label": "عدد غير المقروء", + "appearance.unread_count.view_and_subscription.label": "عرض في الشريط الجانبي", "general.app": "تطبيق", "general.data_persist.description": "حفظ البيانات محليًا لتمكين الوصول دون اتصال والبحث المحلي.", "general.data_persist.label": "حفظ البيانات للاستخدام دون اتصال", diff --git a/locales/settings/ar-TN.json b/locales/settings/ar-TN.json index 5e5d2198e..a79f9f74b 100644 --- a/locales/settings/ar-TN.json +++ b/locales/settings/ar-TN.json @@ -52,8 +52,6 @@ "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.label": "حجم النص", "appearance.theme.dark": "داكن", @@ -62,7 +60,9 @@ "appearance.theme.system": "النظام", "appearance.title": "المظهر", "appearance.ui_font": "خط واجهة المستخدم", - "appearance.unread_count": "عدد العناصر غير المقروءة", + "appearance.unread_count.badge.label": "إظهار كشارة في Dock", + "appearance.unread_count.label": "عدد العناصر غير المقروءة", + "appearance.unread_count.view_and_subscription.label": "عرض في الشريط الجانبي", "feeds.claimTips": "للمطالبة بتغذياتك واستلام الإكراميات، انقر بزر الماوس الأيمن على التغذية في قائمة اشتراكاتك واختر المطالبة.", "feeds.noFeeds": "لا توجد تغذيات مطالبة", "feeds.tableHeaders.name": "الاسم", diff --git a/locales/settings/de.json b/locales/settings/de.json index 892739ac1..7d77a2057 100644 --- a/locales/settings/de.json +++ b/locales/settings/de.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Reduzierung der Bewegung von Elementen zur Leistungsverbesserung und Energieeinsparung", "appearance.reduce_motion.label": "Bewegung reduzieren", "appearance.save": "Speichern", - "appearance.show_dock_badge.label": "Als Dock-Abzeichen anzeigen", - "appearance.sidebar_show_unread_count.label": "Im Seitenmenü anzeigen", "appearance.sidebar_title": "Aussehen", "appearance.text_size.label": "Textgröße", "appearance.theme.dark": "Dunkel", @@ -62,7 +60,9 @@ "appearance.theme.system": "System", "appearance.title": "Aussehen", "appearance.ui_font": "UI-Schriftart", - "appearance.unread_count": "Ungelesene Anzahl", + "appearance.unread_count.badge.label": "Als Dock-Abzeichen anzeigen", + "appearance.unread_count.label": "Ungelesene Anzahl", + "appearance.unread_count.view_and_subscription.label": "Im Seitenmenü anzeigen", "appearance.use_pointer_cursor.description": "Wenn der Mauszeiger über ein interaktives Element bewegt wird, erscheint der Cursor als Hand.", "appearance.use_pointer_cursor.label": "Den Hand-Cursor verwenden", "common.give_star": "Lieben Sie unser Produkt? Geben Sie uns einen Stern auf GitHub!", diff --git a/locales/settings/en.json b/locales/settings/en.json index 7d5bf8828..14cc4abe2 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -95,11 +95,7 @@ "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.show_unread_count.description": "Show unread count in the subscription list", - "appearance.show_unread_count.label": "Show unread count", "appearance.sidebar": "Sidebar", - "appearance.sidebar_show_unread_count.label": "Show in sidebar", "appearance.sidebar_title": "Appearance", "appearance.subscriptions": "Subscriptions", "appearance.text_size.default": "Default", @@ -117,7 +113,9 @@ "appearance.thumbnail_ratio.title": "Thumbnail ratio", "appearance.title": "Appearance", "appearance.ui_font": "Global Font", - "appearance.unread_count": "Unread count", + "appearance.unread_count.badge.label": "Show as badge", + "appearance.unread_count.label": "Unread count", + "appearance.unread_count.view_and_subscription.label": "Show in view and subscription", "appearance.use_pointer_cursor.description": "When the mouse hovers over any interactive element, the cursor appears as a hand.", "appearance.use_pointer_cursor.label": "Use hand cursor", "appearance.zen_mode.description": "Zen mode is an undisturbed reading mode that allows you to focus on the content without any interference. Enabling Zen mode will hide the sidebar.", diff --git a/locales/settings/es.json b/locales/settings/es.json index b2dcb39d1..7dae5708c 100644 --- a/locales/settings/es.json +++ b/locales/settings/es.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Reducir el movimiento de elementos para mejorar el rendimiento y reducir el consumo de energía", "appearance.reduce_motion.label": "Reducir movimiento", "appearance.save": "Guardar", - "appearance.show_dock_badge.label": "Mostrar como insignia en el Dock", - "appearance.sidebar_show_unread_count.label": "Mostrar en la barra lateral", "appearance.sidebar_title": "Apariencia", "appearance.text_size.label": "Tamaño de texto", "appearance.theme.dark": "Oscuro", @@ -62,7 +60,9 @@ "appearance.theme.system": "Sistema", "appearance.title": "Apariencia", "appearance.ui_font": "Fuente de la interfaz", - "appearance.unread_count": "Conteo de no leídos", + "appearance.unread_count.badge.label": "Mostrar como insignia en el Dock", + "appearance.unread_count.label": "Conteo de no leídos", + "appearance.unread_count.view_and_subscription.label": "Mostrar en la barra lateral", "general.app": "Aplicación", "general.data_persist.description": "Guardar datos localmente para habilitar el acceso sin conexión y la búsqueda local.", "general.data_persist.label": "Guardar datos para uso sin conexión", diff --git a/locales/settings/fi.json b/locales/settings/fi.json index 2295bfa40..ae879c7c5 100644 --- a/locales/settings/fi.json +++ b/locales/settings/fi.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Vähentää elementtien liikettä parantaakseen suorituskykyä ja vähentääkseen energiankulutusta", "appearance.reduce_motion.label": "Vähennä liikettä", "appearance.save": "Tallenna", - "appearance.show_dock_badge.label": "Näytä Dock-merkin yhteydessä", - "appearance.sidebar_show_unread_count.label": "Näytä sivupalkissa", "appearance.sidebar_title": "Ulkoasu", "appearance.text_size.label": "Tekstin koko", "appearance.theme.dark": "Tumma", @@ -62,7 +60,9 @@ "appearance.theme.system": "Järjestelmä", "appearance.title": "Ulkoasu", "appearance.ui_font": "Käyttöliittymän fontti", - "appearance.unread_count": "Lukemattomien määrä", + "appearance.unread_count.badge.label": "Näytä Dock-merkin yhteydessä", + "appearance.unread_count.label": "Lukemattomien määrä", + "appearance.unread_count.view_and_subscription.label": "Näytä sivupalkissa", "general.app": "Sovellus", "general.data_persist.description": "Säilytä dataa paikallisesti mahdollistamaan offline-käyttö ja paikallinen haku.", "general.data_persist.label": "Säilytä dataa offline-käyttöä varten", diff --git a/locales/settings/fr.json b/locales/settings/fr.json index 604bd0409..a52d8054c 100644 --- a/locales/settings/fr.json +++ b/locales/settings/fr.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Réduire le mouvement des éléments pour améliorer les performances et réduire la consommation d'énergie", "appearance.reduce_motion.label": "Réduire les mouvements", "appearance.save": "Enregistrer", - "appearance.show_dock_badge.label": "Afficher comme badge Dock", - "appearance.sidebar_show_unread_count.label": "Afficher dans la barre latérale", "appearance.sidebar_title": "Apparence", "appearance.text_size.label": "Taille du texte", "appearance.theme.dark": "Sombre", @@ -62,7 +60,9 @@ "appearance.theme.system": "Système", "appearance.title": "Apparence", "appearance.ui_font": "Police de l'interface utilisateur", - "appearance.unread_count": "Nombre de non lus", + "appearance.unread_count.badge.label": "Afficher comme badge Dock", + "appearance.unread_count.label": "Nombre de non lus", + "appearance.unread_count.view_and_subscription.label": "Afficher dans la barre latérale", "general.app": "Application", "general.data_persist.description": "Conserver les données localement pour permettre un accès hors ligne et une recherche locale.", "general.data_persist.label": "Conserver les données pour une utilisation hors ligne", diff --git a/locales/settings/it.json b/locales/settings/it.json index c201ba765..f4a17e1f4 100644 --- a/locales/settings/it.json +++ b/locales/settings/it.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Riduzione del movimento degli elementi per migliorare le prestazioni e ridurre il consumo energetico", "appearance.reduce_motion.label": "Riduci movimento", "appearance.save": "Salva", - "appearance.show_dock_badge.label": "Mostra come badge Dock", - "appearance.sidebar_show_unread_count.label": "Mostra nella sidebar", "appearance.sidebar_title": "Aspetto", "appearance.text_size.label": "Dimensione del testo", "appearance.theme.dark": "Scuro", @@ -62,7 +60,9 @@ "appearance.theme.system": "Sistema", "appearance.title": "Aspetto", "appearance.ui_font": "Font dell'interfaccia", - "appearance.unread_count": "Conteggio non letti", + "appearance.unread_count.badge.label": "Mostra come badge Dock", + "appearance.unread_count.label": "Conteggio non letti", + "appearance.unread_count.view_and_subscription.label": "Mostra nella sidebar", "general.app": "App", "general.data_persist.description": "Mantieni i dati localmente per abilitare l'accesso offline e la ricerca locale.", "general.data_persist.label": "Mantieni i dati per l'uso offline", diff --git a/locales/settings/ja.json b/locales/settings/ja.json index 3c0758122..dea9ca9f7 100644 --- a/locales/settings/ja.json +++ b/locales/settings/ja.json @@ -76,9 +76,7 @@ "appearance.reduce_motion.description": "要素の動きを減らして、パフォーマンスを向上させ、エネルギー消費を抑えます", "appearance.reduce_motion.label": "動きを減らす", "appearance.save": "保存", - "appearance.show_dock_badge.label": "Dockバッジとして表示", "appearance.sidebar": "サイドバー", - "appearance.sidebar_show_unread_count.label": "サイドバーに表示", "appearance.sidebar_title": "外観", "appearance.text_size.label": "テキストサイズ", "appearance.theme.dark": "ダーク", @@ -91,7 +89,9 @@ "appearance.thumbnail_ratio.title": "サムネイル比率", "appearance.title": "外観", "appearance.ui_font": "UI フォント", - "appearance.unread_count": "未読数", + "appearance.unread_count.badge.label": "Dockバッジとして表示", + "appearance.unread_count.label": "未読数", + "appearance.unread_count.view_and_subscription.label": "サイドバーに表示", "appearance.use_pointer_cursor.description": "マウスがインタラクティブな要素の上にあるとき、カーソルは手の形になります。", "appearance.use_pointer_cursor.label": "手の形のカーソルを使用する", "appearance.zen_mode.description": "Zen モードは、邪魔されることなくコンテンツに集中できる読書モードです。Zenモードを有効にすると、サイドバーが非表示になります。", diff --git a/locales/settings/ko.json b/locales/settings/ko.json index 20cc16271..fa070d06d 100644 --- a/locales/settings/ko.json +++ b/locales/settings/ko.json @@ -76,9 +76,7 @@ "appearance.reduce_motion.description": "요소의 움직임을 줄여 성능을 개선하고 에너지 소비를 줄입니다", "appearance.reduce_motion.label": "움직임 줄이기", "appearance.save": "저장", - "appearance.show_dock_badge.label": "Dock 배지로 표시", "appearance.sidebar": "Sidebar", - "appearance.sidebar_show_unread_count.label": "사이드바에 표시", "appearance.sidebar_title": "외관", "appearance.text_size.label": "텍스트 크기", "appearance.theme.dark": "다크", @@ -91,7 +89,9 @@ "appearance.thumbnail_ratio.title": "썸네일 비율", "appearance.title": "외관", "appearance.ui_font": "UI 글꼴", - "appearance.unread_count": "읽지 않은 수", + "appearance.unread_count.badge.label": "Dock 배지로 표시", + "appearance.unread_count.label": "읽지 않은 수", + "appearance.unread_count.view_and_subscription.label": "사이드바에 표시", "appearance.use_pointer_cursor.description": "마우스가 상호작용 가능한 요소 위에 있을 때 커서는 손 모양으로 표시됩니다.", "appearance.use_pointer_cursor.label": "손 모양 커서를 사용", "appearance.zen_mode.description": "젠 모드는 콘텐츠에 집중할 수 있도록 방해 요소 없이 읽을 수 있는 모드입니다. 젠 모드를 활성화하면 사이드바가 숨겨집니다.", diff --git a/locales/settings/pt.json b/locales/settings/pt.json index 33609ee20..8b6f0e88a 100644 --- a/locales/settings/pt.json +++ b/locales/settings/pt.json @@ -52,8 +52,6 @@ "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.label": "Tamanho do texto", "appearance.theme.dark": "Escuro", @@ -62,7 +60,9 @@ "appearance.theme.system": "Sistema", "appearance.title": "Aparência", "appearance.ui_font": "Fonte da interface", - "appearance.unread_count": "Contagem de não lidos", + "appearance.unread_count.badge.label": "Mostrar como badge no Dock", + "appearance.unread_count.label": "Contagem de não lidos", + "appearance.unread_count.view_and_subscription.label": "Mostrar na barra lateral", "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", diff --git a/locales/settings/ru.json b/locales/settings/ru.json index 3c1100364..b8788a339 100644 --- a/locales/settings/ru.json +++ b/locales/settings/ru.json @@ -76,9 +76,7 @@ "appearance.reduce_motion.description": "Уменьшение движения элементов для улучшения производительности и снижения энергопотребления", "appearance.reduce_motion.label": "Уменьшить движение", "appearance.save": "Сохранить", - "appearance.show_dock_badge.label": "Показывать как значок в Dock", "appearance.sidebar": "Боковая панель", - "appearance.sidebar_show_unread_count.label": "Показать в боковой панели", "appearance.sidebar_title": "Внешний вид", "appearance.text_size.label": "Размер текста", "appearance.theme.dark": "Тёмная", @@ -91,7 +89,9 @@ "appearance.thumbnail_ratio.title": "Соотношение изображения", "appearance.title": "Внешний вид", "appearance.ui_font": "Шрифт интерфейса", - "appearance.unread_count": "Количество непрочитанного", + "appearance.unread_count.badge.label": "Показывать как значок в Dock", + "appearance.unread_count.label": "Количество непрочитанного", + "appearance.unread_count.view_and_subscription.label": "Показать в боковой панели", "appearance.use_pointer_cursor.description": "Когда курсор мыши наводится на интерактивный элемент, он принимает форму руки.", "appearance.use_pointer_cursor.label": "Использовать курсор в виде руки", "appearance.zen_mode.description": "Режим Zen — это режим чтения без отвлекающих факторов, который позволяет сосредоточиться на содержимом без помех. Включение режима Zen скрывает боковую панель.", diff --git a/locales/settings/tr.json b/locales/settings/tr.json index 98deab004..ab7cfd24e 100644 --- a/locales/settings/tr.json +++ b/locales/settings/tr.json @@ -52,8 +52,6 @@ "appearance.reduce_motion.description": "Performansı artırmak ve enerji tüketimini azaltmak için öğelerin hareketini azaltma", "appearance.reduce_motion.label": "Hareketi azalt", "appearance.save": "Kaydet", - "appearance.show_dock_badge.label": "Dock rozeti olarak göster", - "appearance.sidebar_show_unread_count.label": "Kenar çubuğunda göster", "appearance.sidebar_title": "Görünüm", "appearance.text_size.label": "Metin boyutu", "appearance.theme.dark": "Koyu", @@ -62,7 +60,9 @@ "appearance.theme.system": "Sistem", "appearance.title": "Görünüm", "appearance.ui_font": "Arayüz Yazı Tipi", - "appearance.unread_count": "Okunmamış sayısı", + "appearance.unread_count.badge.label": "Dock rozeti olarak göster", + "appearance.unread_count.label": "Okunmamış sayısı", + "appearance.unread_count.view_and_subscription.label": "Kenar çubuğunda göster", "appearance.use_pointer_cursor.description": "Herhangi bir etkileşimli öğenin üzerine gelindiğinde imleci bir el şeklinde gösterin.", "appearance.use_pointer_cursor.label": "El şeklinde imleci kullanmak", "common.give_star": "Ürünümüzü beğendiniz mi? GitHub'da bize bir yıldız verin!", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index c6d41a93a..818f6d778 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -95,11 +95,7 @@ "appearance.reduce_motion.description": "减弱动态效果以提高整体性能并减少电量消耗。", "appearance.reduce_motion.label": "减弱动态效果", "appearance.save": "保存", - "appearance.show_dock_badge.label": "在应用图标上显示", - "appearance.show_unread_count.description": "在订阅列表中显示未读计数。", - "appearance.show_unread_count.label": "显示未读计数", "appearance.sidebar": "侧边栏", - "appearance.sidebar_show_unread_count.label": "在侧边栏显示", "appearance.sidebar_title": "外观", "appearance.subscriptions": "订阅", "appearance.text_size.default": "默认", @@ -117,7 +113,9 @@ "appearance.thumbnail_ratio.title": "缩略比例", "appearance.title": "外观", "appearance.ui_font": "界面字体", - "appearance.unread_count": "未读数", + "appearance.unread_count.badge.label": "在应用图标上显示", + "appearance.unread_count.label": "未读数", + "appearance.unread_count.view_and_subscription.label": "在视图和订阅源上显示", "appearance.use_pointer_cursor.description": "当鼠标悬停在任何可交互元素上时,光标会显示为手型光标。", "appearance.use_pointer_cursor.label": "使用手型光标", "appearance.zen_mode.description": "禅定模式是一种不受干扰的阅读模式,让你能够专注于内容而不受任何干扰。启用禅定模式将会隐藏侧边栏。", diff --git a/locales/settings/zh-HK.json b/locales/settings/zh-HK.json index d2a41edcb..afe8119c9 100644 --- a/locales/settings/zh-HK.json +++ b/locales/settings/zh-HK.json @@ -87,9 +87,7 @@ "appearance.reduce_motion.description": "減少元素的動態以提升效能及減少耗電", "appearance.reduce_motion.label": "減少動態效果", "appearance.save": "儲存", - "appearance.show_dock_badge.label": "顯示 Dock 標籤", "appearance.sidebar": "側邊欄", - "appearance.sidebar_show_unread_count.label": "側邊欄顯示未讀數量", "appearance.sidebar_title": "外觀", "appearance.text_size.default": "預設", "appearance.text_size.label": "全域文字大小", @@ -106,7 +104,9 @@ "appearance.thumbnail_ratio.title": "縮略圖比例", "appearance.title": "外觀", "appearance.ui_font": "介面字體", - "appearance.unread_count": "未讀數量", + "appearance.unread_count.badge.label": "顯示 Dock 標籤", + "appearance.unread_count.label": "未讀數量", + "appearance.unread_count.view_and_subscription.label": "側邊欄顯示未讀數量", "appearance.use_pointer_cursor.description": "當鼠標懸停在任何互動元素上時,光標會顯示為手型光標。", "appearance.use_pointer_cursor.label": "使用手型光標", "appearance.zen_mode.description": "Zen 模式是一種不受打擾的閱讀模式,讓您專注於內容而不會有任何干擾。啟用 Zen 模式後,側邊欄將被隱藏。", diff --git a/locales/settings/zh-TW.json b/locales/settings/zh-TW.json index 5fb7d4723..a65911957 100644 --- a/locales/settings/zh-TW.json +++ b/locales/settings/zh-TW.json @@ -87,9 +87,7 @@ "appearance.reduce_motion.description": "減少元素的動畫效果以提升效能並降低功耗。", "appearance.reduce_motion.label": "減少動畫", "appearance.save": "儲存", - "appearance.show_dock_badge.label": "在 Dock 圖示上顯示", "appearance.sidebar": "側邊欄", - "appearance.sidebar_show_unread_count.label": "在側邊欄中顯示", "appearance.sidebar_title": "外觀", "appearance.text_size.default": "預設", "appearance.text_size.label": "介面字體大小", @@ -106,7 +104,9 @@ "appearance.thumbnail_ratio.title": "縮略比例", "appearance.title": "外觀", "appearance.ui_font": "介面字體", - "appearance.unread_count": "未讀數量", + "appearance.unread_count.badge.label": "在 Dock 圖示上顯示", + "appearance.unread_count.label": "未讀數量", + "appearance.unread_count.view_and_subscription.label": "在側邊欄中顯示", "appearance.use_pointer_cursor.description": "當滑鼠懸停在任何互動元素上時,游標會顯示為手型游標。", "appearance.use_pointer_cursor.label": "使用手型游標", "appearance.zen_mode.description": "禪定模式是一種防干擾的閱讀模式,你可以專注於內容而不受其他干擾。啟用禪定模式將會隱藏側邊欄。", diff --git a/packages/shared/src/settings/defaults.ts b/packages/shared/src/settings/defaults.ts index 965d28b6a..0a648ca1b 100644 --- a/packages/shared/src/settings/defaults.ts +++ b/packages/shared/src/settings/defaults.ts @@ -84,7 +84,8 @@ export const defaultUISettings: UISettings = { more: [], }, - subscriptionShowUnreadCount: true, + showUnreadCountViewAndSubscriptionMobile: false, + showUnreadCountBadgeMobile: false, } export const defaultIntegrationSettings: IntegrationSettings = { diff --git a/packages/shared/src/settings/interface.ts b/packages/shared/src/settings/interface.ts index ed3d89442..c481ba823 100644 --- a/packages/shared/src/settings/interface.ts +++ b/packages/shared/src/settings/interface.ts @@ -70,7 +70,8 @@ export interface UISettings { } // @mobile - subscriptionShowUnreadCount: boolean + showUnreadCountViewAndSubscriptionMobile: boolean + showUnreadCountBadgeMobile: boolean } export interface IntegrationSettings {