diff --git a/apps/readest-app/public/locales/de/translation.json b/apps/readest-app/public/locales/de/translation.json index 6c74113a..0e485100 100644 --- a/apps/readest-app/public/locales/de/translation.json +++ b/apps/readest-app/public/locales/de/translation.json @@ -114,6 +114,7 @@ "Speak": "Sprechen", "Subjects:": "Themen:", "System Fonts": "System-Schriftarten", + "Table of Contents": "Inhaltsverzeichnis", "TTS not supported in this device": "TTS wird auf diesem Gerät nicht unterstützt", "Theme Color": "Themenfarbe", "Theme Mode": "Themenmodus", diff --git a/apps/readest-app/public/locales/es/translation.json b/apps/readest-app/public/locales/es/translation.json index 56ec1956..1a0794bd 100644 --- a/apps/readest-app/public/locales/es/translation.json +++ b/apps/readest-app/public/locales/es/translation.json @@ -114,6 +114,7 @@ "Speak": "Leer", "Subjects:": "Temas:", "System Fonts": "Fuentes del sistema", + "Table of Contents": "Tabla de contenidos", "TTS not supported in this device": "TTS no es compatible con este dispositivo", "Theme Color": "Color del tema", "Theme Mode": "Modo del tema", @@ -129,4 +130,4 @@ "Wikipedia": "Wikipedia", "Writing Mode": "Modo de escritura", "Your Library": "Tu biblioteca" -} +} \ No newline at end of file diff --git a/apps/readest-app/public/locales/fr/translation.json b/apps/readest-app/public/locales/fr/translation.json index e87e9562..35330191 100644 --- a/apps/readest-app/public/locales/fr/translation.json +++ b/apps/readest-app/public/locales/fr/translation.json @@ -114,6 +114,7 @@ "Speak": "Lire", "Subjects:": "Sujets :", "System Fonts": "Polices système", + "Table of Contents": "Table des matières", "TTS not supported in this device": "La synthèse vocale n'est pas prise en charge sur cet appareil", "Theme Color": "Couleur du thème", "Theme Mode": "Mode du thème", diff --git a/apps/readest-app/public/locales/id/translation.json b/apps/readest-app/public/locales/id/translation.json index 180c6358..b4757a18 100644 --- a/apps/readest-app/public/locales/id/translation.json +++ b/apps/readest-app/public/locales/id/translation.json @@ -114,6 +114,7 @@ "Speak": "Bicara", "Subjects:": "Subjek:", "System Fonts": "Font Sistem", + "Table of Contents": "Daftar Isi", "TTS not supported in this device": "TTS tidak didukung di perangkat ini", "Theme Color": "Warna Tema", "Theme Mode": "Mode Tema", diff --git a/apps/readest-app/public/locales/it/translation.json b/apps/readest-app/public/locales/it/translation.json index 49771fce..0d8e86a7 100644 --- a/apps/readest-app/public/locales/it/translation.json +++ b/apps/readest-app/public/locales/it/translation.json @@ -114,6 +114,7 @@ "Speak": "Leggi", "Subjects:": "Argomenti:", "System Fonts": "Font di sistema", + "Table of Contents": "Indice", "TTS not supported in this device": "TTS non supportato su questo dispositivo", "Theme Color": "Colore tema", "Theme Mode": "Modalità tema", diff --git a/apps/readest-app/public/locales/ja/translation.json b/apps/readest-app/public/locales/ja/translation.json index 0b48c358..26cadd2a 100644 --- a/apps/readest-app/public/locales/ja/translation.json +++ b/apps/readest-app/public/locales/ja/translation.json @@ -114,6 +114,7 @@ "Speak": "読み上げ", "Subjects:": "主題:", "System Fonts": "システムフォント", + "Table of Contents": "目次", "TTS not supported in this device": "このデバイスではTTSがサポートされていません", "Theme Color": "テーマカラー", "Theme Mode": "テーマモード", diff --git a/apps/readest-app/public/locales/ko/translation.json b/apps/readest-app/public/locales/ko/translation.json index de9a05e8..038dd2b1 100644 --- a/apps/readest-app/public/locales/ko/translation.json +++ b/apps/readest-app/public/locales/ko/translation.json @@ -114,6 +114,7 @@ "Speak": "말하기", "Subjects:": "주제:", "System Fonts": "시스템 글꼴", + "Table of Contents": "목차", "TTS not supported in this device": "이 장치에서 TTS가 지원되지 않음", "Theme Color": "테마 색상", "Theme Mode": "테마 모드", diff --git a/apps/readest-app/public/locales/pt/translation.json b/apps/readest-app/public/locales/pt/translation.json index fc7869f4..36bfda61 100644 --- a/apps/readest-app/public/locales/pt/translation.json +++ b/apps/readest-app/public/locales/pt/translation.json @@ -114,6 +114,7 @@ "Speak": "Falar", "Subjects:": "Assuntos:", "System Fonts": "Fontes do Sistema", + "Table of Contents": "Índice", "TTS not supported in this device": "TTS não suportado neste dispositivo", "Theme Color": "Cor do Tema", "Theme Mode": "Modo do Tema", diff --git a/apps/readest-app/public/locales/ru/translation.json b/apps/readest-app/public/locales/ru/translation.json index 4f81f5e3..dbae3680 100644 --- a/apps/readest-app/public/locales/ru/translation.json +++ b/apps/readest-app/public/locales/ru/translation.json @@ -114,6 +114,7 @@ "Speak": "Произнести", "Subjects:": "Темы:", "System Fonts": "Системные шрифты", + "Table of Contents": "Содержание", "TTS not supported in this device": "TTS не поддерживается на этом устройстве", "Theme Color": "Цвет темы", "Theme Mode": "Режим темы", diff --git a/apps/readest-app/public/locales/tr/translation.json b/apps/readest-app/public/locales/tr/translation.json index d10cc6c0..f5d039f0 100644 --- a/apps/readest-app/public/locales/tr/translation.json +++ b/apps/readest-app/public/locales/tr/translation.json @@ -114,6 +114,7 @@ "Speak": "Konuş", "Subjects:": "Konular:", "System Fonts": "Sistem Yazı Tipleri", + "Table of Contents": "İçindekiler", "TTS not supported in this device": "Bu cihazda TTS desteklenmiyor", "Theme Color": "Tema Rengi", "Theme Mode": "Tema Modu", diff --git a/apps/readest-app/public/locales/vi/translation.json b/apps/readest-app/public/locales/vi/translation.json index 2fd49330..4e2de633 100644 --- a/apps/readest-app/public/locales/vi/translation.json +++ b/apps/readest-app/public/locales/vi/translation.json @@ -114,6 +114,7 @@ "Speak": "Đọc", "Subjects:": "Chủ đề:", "System Fonts": "Phông chữ hệ thống", + "Table of Contents": "Mục lục", "TTS not supported in this device": "TTS không được hỗ trợ trên thiết bị này", "Theme Color": "Màu chủ đề", "Theme Mode": "Chế độ chủ đề", diff --git a/apps/readest-app/public/locales/zh-CN/translation.json b/apps/readest-app/public/locales/zh-CN/translation.json index 76dad697..5e48a140 100644 --- a/apps/readest-app/public/locales/zh-CN/translation.json +++ b/apps/readest-app/public/locales/zh-CN/translation.json @@ -114,6 +114,7 @@ "Speak": "朗读", "Subjects:": "主题", "System Fonts": "系统字体", + "Table of Contents": "目录", "TTS not supported in this device": "此设备不支持 TTS", "Theme Color": "主题颜色", "Theme Mode": "主题模式", diff --git a/apps/readest-app/public/locales/zh-TW/translation.json b/apps/readest-app/public/locales/zh-TW/translation.json index 6ecadbdb..013a9880 100644 --- a/apps/readest-app/public/locales/zh-TW/translation.json +++ b/apps/readest-app/public/locales/zh-TW/translation.json @@ -114,6 +114,7 @@ "Speak": "朗讀", "Subjects:": "主題", "System Fonts": "系統字體", + "Table of Contents": "目錄", "TTS not supported in this device": "此設備不支持 TTS", "Theme Color": "主題顏色", "Theme Mode": "主題模式", diff --git a/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx b/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx index c985e2ab..19687579 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx +++ b/apps/readest-app/src/app/reader/components/sidebar/BooknoteItem.tsx @@ -122,7 +122,12 @@ const BooknoteItem: React.FC = ({ bookKey, item }) => { )} onClick={editNote.bind(null, item)} > -
{_('Edit')}
+
{_('Edit')}
)} diff --git a/apps/readest-app/src/app/reader/components/sidebar/Content.tsx b/apps/readest-app/src/app/reader/components/sidebar/Content.tsx index ceca2d95..92fb8b8d 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/Content.tsx +++ b/apps/readest-app/src/app/reader/components/sidebar/Content.tsx @@ -15,6 +15,8 @@ const SidebarContent: React.FC<{ const { getConfig, setConfig } = useBookDataStore(); const config = getConfig(sideBarBookKey); const [activeTab, setActiveTab] = useState(config?.viewSettings?.sideBarTab || 'toc'); + const [fade, setFade] = useState(false); + const [targetTab, setTargetTab] = useState(activeTab); useEffect(() => { const container = scrollContainerRef.current; @@ -49,10 +51,17 @@ const SidebarContent: React.FC<{ }, [sideBarBookKey]); const handleTabChange = (tab: string) => { + setFade(true); + const timeout = setTimeout(() => { + setFade(false) + setTargetTab(tab); + setConfig(sideBarBookKey!, config); + clearTimeout(timeout); + }, 300); + setActiveTab(tab); const config = getConfig(sideBarBookKey!)!; config.viewSettings!.sideBarTab = tab; - setConfig(sideBarBookKey!, config); }; return ( @@ -63,14 +72,20 @@ const SidebarContent: React.FC<{ 'font-sans text-sm font-normal shadow-inner', )} > -
- {activeTab === 'toc' && bookDoc.toc && ( +
+ {targetTab === 'toc' && bookDoc.toc && ( )} - {activeTab === 'annotations' && ( + {targetTab === 'annotations' && ( )} - {activeTab === 'bookmarks' && ( + {targetTab === 'bookmarks' && ( )}
diff --git a/apps/readest-app/src/app/reader/components/sidebar/TOCView.tsx b/apps/readest-app/src/app/reader/components/sidebar/TOCView.tsx index a2a5f014..2fe8380c 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/TOCView.tsx +++ b/apps/readest-app/src/app/reader/components/sidebar/TOCView.tsx @@ -126,7 +126,7 @@ const TOCView: React.FC<{ const rect = currentItem.getBoundingClientRect(); const isVisible = rect.top >= 0 && rect.bottom <= window.innerHeight; if (!isVisible) { - (currentItem as HTMLElement).scrollIntoView({ behavior: 'smooth', block: 'center' }); + (currentItem as HTMLElement).scrollIntoView({ behavior: 'instant', block: 'center' }); } (currentItem as HTMLElement).setAttribute('aria-current', 'page'); } diff --git a/apps/readest-app/src/app/reader/components/sidebar/TabNavigation.tsx b/apps/readest-app/src/app/reader/components/sidebar/TabNavigation.tsx index 7f6c3bd1..c32a4893 100644 --- a/apps/readest-app/src/app/reader/components/sidebar/TabNavigation.tsx +++ b/apps/readest-app/src/app/reader/components/sidebar/TabNavigation.tsx @@ -1,23 +1,54 @@ +import clsx from 'clsx'; import React from 'react'; import { MdToc, MdEditNote, MdBookmarkBorder } from 'react-icons/md'; +import { useTranslation } from '@/hooks/useTranslation'; + const TabNavigation: React.FC<{ activeTab: string; onTabChange: (tab: string) => void; -}> = ({ activeTab, onTabChange }) => ( -
- {['toc', 'annotations', 'bookmarks'].map((tab) => ( - - ))} -
-); +}> = ({ activeTab, onTabChange }) => { + const _ = useTranslation(); + + const tabs = ['toc', 'annotations', 'bookmarks']; + + return ( +
+
+ {tabs.map((tab) => ( +
+
onTabChange(tab)} + > + { + tab === 'toc' ? ( + + ) : tab === 'annotations' ? ( + + ) : ( + + ) + } +
+
+ ))} +
+ ) +}; export default TabNavigation;