From d220adbfdffe923ff67ea07792d67dff2b01d1d8 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Mon, 13 Jan 2025 20:04:04 +0100 Subject: [PATCH] TTS UX enhancements (#148) * Fix toast of PDF unsupported for TTS * Use vertical scroll for large dropdown menus --- .../public/locales/de/translation.json | 3 ++- .../public/locales/es/translation.json | 5 +++-- .../public/locales/fr/translation.json | 3 ++- .../public/locales/id/translation.json | 3 ++- .../public/locales/it/translation.json | 3 ++- .../public/locales/ja/translation.json | 3 ++- .../public/locales/ko/translation.json | 3 ++- .../public/locales/pt/translation.json | 3 ++- .../public/locales/ru/translation.json | 3 ++- .../public/locales/tr/translation.json | 3 ++- .../public/locales/vi/translation.json | 3 ++- .../public/locales/zh-CN/translation.json | 3 ++- .../public/locales/zh-TW/translation.json | 3 ++- .../reader/components/settings/FontDropDown.tsx | 2 +- .../components/settings/SettingsDialog.tsx | 2 +- .../src/app/reader/components/tts/TTSControl.tsx | 16 +++++++++++++--- .../src/app/reader/components/tts/TTSPanel.tsx | 4 ++-- 17 files changed, 44 insertions(+), 21 deletions(-) diff --git a/apps/readest-app/public/locales/de/translation.json b/apps/readest-app/public/locales/de/translation.json index 0e485100..ed6570bc 100644 --- a/apps/readest-app/public/locales/de/translation.json +++ b/apps/readest-app/public/locales/de/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Willkommen in Ihrer Bibliothek. Sie können hier Ihre Bücher importieren und jederzeit lesen.", "Wikipedia": "Wikipedia", "Writing Mode": "Schreibmodus", - "Your Library": "Ihre Bibliothek" + "Your Library": "Ihre Bibliothek", + "TTS not supported for PDF": "TTS wird für PDF nicht unterstützt" } diff --git a/apps/readest-app/public/locales/es/translation.json b/apps/readest-app/public/locales/es/translation.json index 1a0794bd..8e43612c 100644 --- a/apps/readest-app/public/locales/es/translation.json +++ b/apps/readest-app/public/locales/es/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Bienvenido a tu biblioteca. Puedes importar tus libros aquí y leerlos en cualquier momento.", "Wikipedia": "Wikipedia", "Writing Mode": "Modo de escritura", - "Your Library": "Tu biblioteca" -} \ No newline at end of file + "Your Library": "Tu biblioteca", + "TTS not supported for PDF": "TTS no es compatible con PDF" +} diff --git a/apps/readest-app/public/locales/fr/translation.json b/apps/readest-app/public/locales/fr/translation.json index 35330191..c9251abc 100644 --- a/apps/readest-app/public/locales/fr/translation.json +++ b/apps/readest-app/public/locales/fr/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Bienvenue dans votre bibliothèque. Vous pouvez importer vos livres ici et les lire à tout moment.", "Wikipedia": "Wikipédia", "Writing Mode": "Mode écriture", - "Your Library": "Votre bibliothèque" + "Your Library": "Votre bibliothèque", + "TTS not supported for PDF": "La synthèse vocale n'est pas prise en charge pour les fichiers PDF" } diff --git a/apps/readest-app/public/locales/id/translation.json b/apps/readest-app/public/locales/id/translation.json index b4757a18..bb51a771 100644 --- a/apps/readest-app/public/locales/id/translation.json +++ b/apps/readest-app/public/locales/id/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Selamat datang di perpustakaan Anda. Anda dapat mengimpor buku-buku Anda di sini dan membacanya kapan saja.", "Wikipedia": "Wikipedia", "Writing Mode": "Mode Menulis", - "Your Library": "Perpustakaan Anda" + "Your Library": "Perpustakaan Anda", + "TTS not supported for PDF": "TTS tidak didukung untuk PDF" } diff --git a/apps/readest-app/public/locales/it/translation.json b/apps/readest-app/public/locales/it/translation.json index 0d8e86a7..0193c88e 100644 --- a/apps/readest-app/public/locales/it/translation.json +++ b/apps/readest-app/public/locales/it/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Benvenuto nella tua biblioteca. Puoi importare i tuoi libri qui e leggerli in qualsiasi momento.", "Wikipedia": "Wikipedia", "Writing Mode": "Modalità scrittura", - "Your Library": "La tua biblioteca" + "Your Library": "La tua biblioteca", + "TTS not supported for PDF": "TTS non supportato per PDF" } diff --git a/apps/readest-app/public/locales/ja/translation.json b/apps/readest-app/public/locales/ja/translation.json index 26cadd2a..22fb67b2 100644 --- a/apps/readest-app/public/locales/ja/translation.json +++ b/apps/readest-app/public/locales/ja/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "ライブラリーへようこそ。ここに書籍をインポートして、いつでも読むことができます。", "Wikipedia": "ウィキペディア", "Writing Mode": "書き込みモード", - "Your Library": "ライブラリー" + "Your Library": "ライブラリー", + "TTS not supported for PDF": "PDFではTTSがサポートされていません" } diff --git a/apps/readest-app/public/locales/ko/translation.json b/apps/readest-app/public/locales/ko/translation.json index 038dd2b1..45750262 100644 --- a/apps/readest-app/public/locales/ko/translation.json +++ b/apps/readest-app/public/locales/ko/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "내 서재에 오신 것을 환영합니다. 여기에서 책을 가져와 언제든지 읽을 수 있습니다.", "Wikipedia": "위키피디아", "Writing Mode": "글쓰기 모드", - "Your Library": "내 서재" + "Your Library": "내 서재", + "TTS not supported for PDF": "PDF에서 TTS가 지원되지 않음" } diff --git a/apps/readest-app/public/locales/pt/translation.json b/apps/readest-app/public/locales/pt/translation.json index 36bfda61..dce43916 100644 --- a/apps/readest-app/public/locales/pt/translation.json +++ b/apps/readest-app/public/locales/pt/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Bem-vindo à sua biblioteca. Você pode importar seus livros aqui e lê-los a qualquer momento.", "Wikipedia": "Wikipédia", "Writing Mode": "Modo de Escrita", - "Your Library": "Sua Biblioteca" + "Your Library": "Sua Biblioteca", + "TTS not supported for PDF": "TTS não suportado para PDF" } diff --git a/apps/readest-app/public/locales/ru/translation.json b/apps/readest-app/public/locales/ru/translation.json index dbae3680..85955322 100644 --- a/apps/readest-app/public/locales/ru/translation.json +++ b/apps/readest-app/public/locales/ru/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Добро пожаловать в вашу библиотеку. Вы можете импортировать сюда книги и читать их в любое время.", "Wikipedia": "Википедия", "Writing Mode": "Режим записи", - "Your Library": "Ваша библиотека" + "Your Library": "Ваша библиотека", + "TTS not supported for PDF": "TTS не поддерживается для PDF" } diff --git a/apps/readest-app/public/locales/tr/translation.json b/apps/readest-app/public/locales/tr/translation.json index f5d039f0..417ce8b4 100644 --- a/apps/readest-app/public/locales/tr/translation.json +++ b/apps/readest-app/public/locales/tr/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Kütüphanenize hoş geldiniz. Buradan kitaplarınızı içe aktarabilir ve istediğiniz zaman okuyabilirsiniz.", "Wikipedia": "Vikipedi", "Writing Mode": "Yazma Modu", - "Your Library": "Kütüphaneniz" + "Your Library": "Kütüphaneniz", + "TTS not supported for PDF": "PDF için TTS desteklenmiyor" } diff --git a/apps/readest-app/public/locales/vi/translation.json b/apps/readest-app/public/locales/vi/translation.json index 4e2de633..46bd3bc6 100644 --- a/apps/readest-app/public/locales/vi/translation.json +++ b/apps/readest-app/public/locales/vi/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "Chào mừng đến với thư viện của bạn. Bạn có thể nhập sách vào đây và đọc bất cứ lúc nào.", "Wikipedia": "Wikipedia", "Writing Mode": "Chế độ viết", - "Your Library": "Thư viện của bạn" + "Your Library": "Thư viện của bạn", + "TTS not supported for PDF": "TTS không được hỗ trợ cho PDF" } diff --git a/apps/readest-app/public/locales/zh-CN/translation.json b/apps/readest-app/public/locales/zh-CN/translation.json index 5e48a140..8508c962 100644 --- a/apps/readest-app/public/locales/zh-CN/translation.json +++ b/apps/readest-app/public/locales/zh-CN/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "书库空空如也,您可以导入您的书籍并随时阅读。", "Wikipedia": "维基百科", "Writing Mode": "排版模式", - "Your Library": "书库" + "Your Library": "书库", + "TTS not supported for PDF": "PDF 文档暂不支持 TTS" } diff --git a/apps/readest-app/public/locales/zh-TW/translation.json b/apps/readest-app/public/locales/zh-TW/translation.json index 013a9880..3ef1e3cd 100644 --- a/apps/readest-app/public/locales/zh-TW/translation.json +++ b/apps/readest-app/public/locales/zh-TW/translation.json @@ -129,5 +129,6 @@ "Welcome to your library. You can import your books here and read them anytime.": "書庫空空如也,您可以導入您的書籍並隨時閱讀。", "Wikipedia": "維基百科", "Writing Mode": "排版模式", - "Your Library": "書庫" + "Your Library": "書庫", + "TTS not supported for PDF": "PDF 文檔暫不支持 TTS" } diff --git a/apps/readest-app/src/app/reader/components/settings/FontDropDown.tsx b/apps/readest-app/src/app/reader/components/settings/FontDropDown.tsx index 849dd657..5f29fba6 100644 --- a/apps/readest-app/src/app/reader/components/settings/FontDropDown.tsx +++ b/apps/readest-app/src/app/reader/components/settings/FontDropDown.tsx @@ -57,7 +57,7 @@ const FontDropdown: React.FC = ({ tabIndex={0} className={clsx( 'dropdown-content bgcolor-base-200 menu rounded-box relative z-[1] overflow-y-scroll shadow', - '!mr-5 mb-[-46px] max-h-80 w-[292px]', + '!mr-5 mb-[-46px] inline max-h-80 w-[250px] overflow-y-scroll', )} > {moreOptions.map((option) => ( diff --git a/apps/readest-app/src/app/reader/components/settings/SettingsDialog.tsx b/apps/readest-app/src/app/reader/components/settings/SettingsDialog.tsx index cc0763e9..0b97ceb9 100644 --- a/apps/readest-app/src/app/reader/components/settings/SettingsDialog.tsx +++ b/apps/readest-app/src/app/reader/components/settings/SettingsDialog.tsx @@ -39,7 +39,7 @@ const SettingsDialog: React.FC<{ bookKey: string; config: BookConfig }> = ({ boo return ( -
+