From 6788b73658c0a9dd8bb6898d84e721675ba7672b Mon Sep 17 00:00:00 2001 From: NBA2K1 <78034913+NBA2K1@users.noreply.github.com> Date: Tue, 8 Jul 2025 04:19:40 +0200 Subject: [PATCH] Delete whole imported manga Delete whole imported manga when all chapters have been deleted. + Added a warning message and translations --- lib/l10n/app_ar.arb | 11 +++ lib/l10n/app_de.arb | 11 +++ lib/l10n/app_en.arb | 12 +++ lib/l10n/app_es.arb | 11 +++ lib/l10n/app_es_419.arb | 11 +++ lib/l10n/app_fr.arb | 11 +++ lib/l10n/app_id.arb | 11 +++ lib/l10n/app_it.arb | 11 +++ lib/l10n/app_pt.arb | 11 +++ lib/l10n/app_pt_BR.arb | 11 +++ lib/l10n/app_ru.arb | 11 +++ lib/l10n/app_th.arb | 11 +++ lib/l10n/app_tr.arb | 11 +++ lib/l10n/app_zh.arb | 11 +++ lib/l10n/generated/app_localizations.dart | 23 ++++++ lib/l10n/generated/app_localizations_ar.dart | 23 ++++++ lib/l10n/generated/app_localizations_de.dart | 24 ++++++ lib/l10n/generated/app_localizations_en.dart | 24 ++++++ lib/l10n/generated/app_localizations_es.dart | 48 +++++++++++ lib/l10n/generated/app_localizations_fr.dart | 24 ++++++ lib/l10n/generated/app_localizations_id.dart | 24 ++++++ lib/l10n/generated/app_localizations_it.dart | 24 ++++++ lib/l10n/generated/app_localizations_pt.dart | 48 +++++++++++ lib/l10n/generated/app_localizations_ru.dart | 24 ++++++ lib/l10n/generated/app_localizations_th.dart | 23 ++++++ lib/l10n/generated/app_localizations_tr.dart | 23 ++++++ lib/l10n/generated/app_localizations_zh.dart | 22 +++++ .../manga/detail/manga_detail_view.dart | 82 ++++++++++++++++--- 28 files changed, 581 insertions(+), 10 deletions(-) diff --git a/lib/l10n/app_ar.arb b/lib/l10n/app_ar.arb index 322657f3..bce2661b 100644 --- a/lib/l10n/app_ar.arb +++ b/lib/l10n/app_ar.arb @@ -17,6 +17,17 @@ "alphabetically": "أبجدياً", "last_read": "آخر قراءة", "last_update_check": "آخر فحص للتحديثات", + "last_entry_delete_warning": "{count, plural, =1{أنت بتحذف الـ{entryType} الوحيد من هذا الـ{mediaType} من المكتبة.} other{أنت بتحذف كل الـ{count} {entryTypePlural} من هذا الـ{mediaType} من المكتبة.}}\nهذا كمان هيشيل الـ{mediaType} بالكامل من مكتبتك.\n\nملاحظة: الملفات نفسها مش هتتحذف.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "فصل", + "episode": "حلقة", "unread_count": "عدد غير المقروء", "latest_chapter": "أحدث فصل", "date_added": "تاريخ الإضافة", diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index a9baf5b8..d3204cfc 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -19,6 +19,17 @@ "last_read": "Zuletzt gelesen", "last_watched": "Zuletzt angeschaut", "last_update_check": "Letzte Aktualisierungsprüfung", + "last_entry_delete_warning": "{count, plural, =1{Du löschst das einzige {entryType} dieses {mediaType}s aus deiner Bibliothek.} other{Du löschst alle {count} {entryTypePlural} dieses {mediaType}s aus deiner Bibliothek.}}\nDadurch wird auch der ganze {mediaType} aus deiner Bibliothek entfernt.\n\nHinweis: Die Dateien selbst werden nicht gelöscht.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "Kapitel", + "episode": "Episode", "unread_count": "Ungelesene Anzahl", "unwatched_count": "Ungesehene Anzahl", "latest_chapter": "Letztes Kapitel", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 65bd5092..c6dfa3ed 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -19,6 +19,18 @@ "last_read": "Last read", "last_watched": "Last watched", "last_update_check": "Last update check", + "last_entry_delete_warning": "{count, plural, =1{You are deleting the only {entryType} of this {mediaType} from the library.} other{You are deleting all {count} {entryTypePlural} of this {mediaType} from the library.}}\nThis will also remove the whole {mediaType} from your library.\n\nNote: The files themselves will not be deleted.", + "@last_entry_delete_warning": { + "description": "Warning when deleting all entries (chapters/episodes) of a manga/anime.", + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "chapter", + "episode": "episode", "unread_count": "Unread count", "unwatched_count": "Unwatched count", "latest_chapter": "Latest chapter", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 816b3e03..4f92f061 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabéticamente", "last_read": "Última lectura", "last_update_check": "Última verificación de actualización", + "last_entry_delete_warning": "{count, plural, =1{Estás borrando el único {entryType} de este {mediaType} de tu biblioteca.} other{Estás borrando los {count} {entryTypePlural} de este {mediaType} de tu biblioteca.}}\nEsto también quitará todo el {mediaType} de tu biblioteca.\n\nNota: Los archivos en sí no se borrarán.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "capítulo", + "episode": "episodio", "unread_count": "Cuenta de no leídos", "latest_chapter": "Último capítulo", "date_added": "Fecha añadida", diff --git a/lib/l10n/app_es_419.arb b/lib/l10n/app_es_419.arb index 4f72c1e8..ff2172c7 100644 --- a/lib/l10n/app_es_419.arb +++ b/lib/l10n/app_es_419.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabéticamente", "last_read": "Última lectura", "last_update_check": "Última verificación de actualización", + "last_entry_delete_warning": "{count, plural, =1{Estás borrando el único {entryType} de este {mediaType} de tu biblioteca.} other{Estás borrando los {count} {entryTypePlural} de este {mediaType} de tu biblioteca.}}\nEsto también quitará todo el {mediaType} de tu biblioteca.\n\nNota: Los archivos en sí no se borrarán.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "capítulo", + "episode": "episodio", "unread_count": "Cuenta de no leídos", "latest_chapter": "Último capítulo", "date_added": "Fecha añadida", diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 2fc27a0d..c05663ab 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -17,6 +17,17 @@ "alphabetically": "Alphabétiquement", "last_read": "Dernier lu", "last_update_check": "Dernière mise à jour", + "last_entry_delete_warning": "{count, plural, =1{Tu es en train de supprimer le seul {entryType} de ce {mediaType} de ta bibliothèque.} other{Tu es en train de supprimer les {count} {entryTypePlural} de ce {mediaType} de ta bibliothèque.}}\nÇa va aussi supprimer tout le {mediaType} de ta bibliothèque.\n\nNote : Les fichiers ne seront pas supprimés.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "chapitre", + "episode": "épisode", "unread_count": "Nombre de non-lus", "latest_chapter": "Dernier chapitre", "date_added": "Date ajoutée", diff --git a/lib/l10n/app_id.arb b/lib/l10n/app_id.arb index b8522902..bbe0f887 100644 --- a/lib/l10n/app_id.arb +++ b/lib/l10n/app_id.arb @@ -17,6 +17,17 @@ "alphabetically": "Secara Abjad", "last_read": "Bacaan Terakhir", "last_update_check": "Pemeriksaan Pembaruan Terakhir", + "last_entry_delete_warning": "{count, plural, =1{Kamu sedang menghapus satu-satunya {entryType} dari {mediaType} ini di perpustakaan kamu.} other{Kamu sedang menghapus semua {count} {entryTypePlural} dari {mediaType} ini di perpustakaan kamu.}}\nIni juga akan menghapus seluruh {mediaType} dari perpustakaanmu.\n\nCatatan: File-nya sendiri tidak akan dihapus.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "bab", + "episode": "episode", "unread_count": "Jumlah Belum Dibaca", "latest_chapter": "Bab Terbaru", "date_added": "Tanggal Ditambahkan", diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index c9eac9cb..ed90a0a9 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabeticamente", "last_read": "Ultima lettura", "last_update_check": "Ultimo controllo aggiornamenti", + "last_entry_delete_warning": "{count, plural, =1{Stai eliminando l’unico {entryType} di questo {mediaType} dalla tua libreria.} other{Stai eliminando tutti e {count} {entryTypePlural} di questo {mediaType} dalla tua libreria.}}\nQuesto rimuoverà anche tutto il {mediaType} dalla tua libreria.\n\nNota: I file non saranno eliminati.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "capitolo", + "episode": "episodio", "unread_count": "Conteggio non letti", "latest_chapter": "Ultimo capitolo", "date_added": "Data aggiunta", diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index 606be8de..0d0670b4 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabeticamente", "last_read": "Última leitura", "last_update_check": "Última verificação de atualização", + "last_entry_delete_warning": "{count, plural, =1{Estás a eliminar o único {entryType} deste {mediaType} da tua biblioteca.} other{Estás a eliminar todos os {count} {entryTypePlural} deste {mediaType} da tua biblioteca.}}\nIsto vai também remover todo o {mediaType} da tua biblioteca.\n\nNota: Os ficheiros em si não vão ser eliminados.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "capítulo", + "episode": "episódio", "unread_count": "Contagem de não lidos", "latest_chapter": "Último capítulo", "date_added": "Data de adição", diff --git a/lib/l10n/app_pt_BR.arb b/lib/l10n/app_pt_BR.arb index 413a7183..0f18cb59 100644 --- a/lib/l10n/app_pt_BR.arb +++ b/lib/l10n/app_pt_BR.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabeticamente", "last_read": "Última leitura", "last_update_check": "Última verificação de atualização", + "last_entry_delete_warning": "{count, plural, =1{Você está deletando o único {entryType} deste {mediaType} da sua biblioteca.} other{Você está deletando todos os {count} {entryTypePlural} deste {mediaType} da sua biblioteca.}}\nIsso também vai remover todo o {mediaType} da sua biblioteca.\n\nObs: Os arquivos em si não serão deletados.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "capítulo", + "episode": "episódio", "unread_count": "Contagem de não lidos", "latest_chapter": "Último capítulo", "date_added": "Data adicionada", diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index f084b07b..212ce014 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -17,6 +17,17 @@ "alphabetically": "По алфавиту", "last_read": "Последнее чтение", "last_update_check": "Последняя проверка обновлений", + "last_entry_delete_warning": "{count, plural, =1{Ты удаляешь единственный {entryType} этого {mediaType} из библиотеки.} other{Ты удаляешь все {count} {entryTypePlural} этого {mediaType} из библиотеки.}}\nЭто также удалит весь {mediaType} из твоей библиотеки.\n\nПримечание: Сами файлы удалены не будут.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "глава", + "episode": "эпизод", "unread_count": "Количество непрочитанных", "latest_chapter": "Последняя глава", "date_added": "Дата добавления", diff --git a/lib/l10n/app_th.arb b/lib/l10n/app_th.arb index 9c39f02c..32c3a848 100644 --- a/lib/l10n/app_th.arb +++ b/lib/l10n/app_th.arb @@ -20,6 +20,17 @@ "alphabetically": "ตามตัวอักษร", "last_read": "อ่านล่าสุด", "last_update_check": "ตรวจการอัพเดท", + "last_entry_delete_warning": "{count, plural, =1{คุณกำลังลบ{entryType}เดียวของ{mediaType}นี้ออกจากคลังของคุณ} other{คุณกำลังลบทั้งหมด {count} {entryTypePlural}ของ{mediaType}นี้ออกจากคลังของคุณ}}\nสิ่งนี้จะลบ{mediaType}ทั้งหมดออกจากคลังของคุณด้วย\n\nหมายเหตุ: ไฟล์จะไม่ถูกลบ", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "บท", + "episode": "ตอน", "unread_count": "ที่ยังไม่อ่าน", "latest_chapter": "ตอนล่าสุด", "date_added": "วันที่เพิ่ม", diff --git a/lib/l10n/app_tr.arb b/lib/l10n/app_tr.arb index cad3c3d8..223317b8 100644 --- a/lib/l10n/app_tr.arb +++ b/lib/l10n/app_tr.arb @@ -17,6 +17,17 @@ "alphabetically": "Alfabetik Olarak", "last_read": "Son Okunan", "last_update_check": "Son Güncelleme Kontrolü", + "last_entry_delete_warning": "{count, plural, =1{Kitaplığından bu {mediaType}’nin tek {entryType}’ünü siliyorsun.} other{Kitaplığından bu {mediaType}’nin tüm {count} {entryTypePlural}’ini siliyorsun.}}\nBu işlem {mediaType}’nin tamamını da kütüphanenden kaldıracak.\n\nNot: Dosyalar silinmeyecek.", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "bölüm", + "episode": "bölüm", "unread_count": "Okunmamış Sayısı", "latest_chapter": "Son Bölüm", "date_added": "Eklenme Tarihi", diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 7742199d..c824f57d 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -20,6 +20,17 @@ "alphabetically": "按字母顺序", "last_read": "最后阅读", "last_update_check": "最后更新检查", + "last_entry_delete_warning": "{count, plural, =1{你正在从你的库中删除此{mediaType}的唯一{entryType}。} other{你正在从你的库中删除此{mediaType}的全部{count}{entryTypePlural}。}}\n这也会将整个{mediaType}从你的库中移除。\n\n注意:文件本身不会被删除。", + "@last_entry_delete_warning": { + "placeholders": { + "count": {}, + "entryType": {}, + "entryTypePlural": {}, + "mediaType": {} + } + }, + "chapter": "章节", + "episode": "剧集", "unread_count": "未读计数", "latest_chapter": "最新章节", "date_added": "添加日期", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index 73b04975..cb789975 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -234,6 +234,29 @@ abstract class AppLocalizations { /// **'Last update check'** String get last_update_check; + /// Warning when deleting all entries (chapters/episodes) of a manga/anime. + /// + /// In en, this message translates to: + /// **'{count, plural, =1{You are deleting the only {entryType} of this {mediaType} from the library.} other{You are deleting all {count} {entryTypePlural} of this {mediaType} from the library.}}\nThis will also remove the whole {mediaType} from your library.\n\nNote: The files themselves will not be deleted.'** + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ); + + /// No description provided for @chapter. + /// + /// In en, this message translates to: + /// **'chapter'** + String get chapter; + + /// No description provided for @episode. + /// + /// In en, this message translates to: + /// **'episode'** + String get episode; + /// No description provided for @unread_count. /// /// In en, this message translates to: diff --git a/lib/l10n/generated/app_localizations_ar.dart b/lib/l10n/generated/app_localizations_ar.dart index 6a7daa3a..21db1d6c 100644 --- a/lib/l10n/generated/app_localizations_ar.dart +++ b/lib/l10n/generated/app_localizations_ar.dart @@ -65,6 +65,29 @@ class AppLocalizationsAr extends AppLocalizations { @override String get last_update_check => 'آخر فحص للتحديثات'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'أنت بتحذف كل الـ$count $entryTypePlural من هذا الـ$mediaType من المكتبة.', + one: 'أنت بتحذف الـ$entryType الوحيد من هذا الـ$mediaType من المكتبة.', + ); + return '$_temp0\nهذا كمان هيشيل الـ$mediaType بالكامل من مكتبتك.\n\nملاحظة: الملفات نفسها مش هتتحذف.'; + } + + @override + String get chapter => 'فصل'; + + @override + String get episode => 'حلقة'; + @override String get unread_count => 'عدد غير المقروء'; diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 9b5e3067..ed33e6c9 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -65,6 +65,30 @@ class AppLocalizationsDe extends AppLocalizations { @override String get last_update_check => 'Letzte Aktualisierungsprüfung'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Du löschst alle $count $entryTypePlural dieses ${mediaType}s aus deiner Bibliothek.', + one: + 'Du löschst das einzige $entryType dieses ${mediaType}s aus deiner Bibliothek.', + ); + return '$_temp0\nDadurch wird auch der ganze $mediaType aus deiner Bibliothek entfernt.\n\nHinweis: Die Dateien selbst werden nicht gelöscht.'; + } + + @override + String get chapter => 'Kapitel'; + + @override + String get episode => 'Episode'; + @override String get unread_count => 'Ungelesene Anzahl'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 95bf0792..37742519 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -65,6 +65,30 @@ class AppLocalizationsEn extends AppLocalizations { @override String get last_update_check => 'Last update check'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'You are deleting all $count $entryTypePlural of this $mediaType from the library.', + one: + 'You are deleting the only $entryType of this $mediaType from the library.', + ); + return '$_temp0\nThis will also remove the whole $mediaType from your library.\n\nNote: The files themselves will not be deleted.'; + } + + @override + String get chapter => 'chapter'; + + @override + String get episode => 'episode'; + @override String get unread_count => 'Unread count'; diff --git a/lib/l10n/generated/app_localizations_es.dart b/lib/l10n/generated/app_localizations_es.dart index 70963365..67b1d83c 100644 --- a/lib/l10n/generated/app_localizations_es.dart +++ b/lib/l10n/generated/app_localizations_es.dart @@ -65,6 +65,30 @@ class AppLocalizationsEs extends AppLocalizations { @override String get last_update_check => 'Última verificación de actualización'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Estás borrando los $count $entryTypePlural de este $mediaType de tu biblioteca.', + one: + 'Estás borrando el único $entryType de este $mediaType de tu biblioteca.', + ); + return '$_temp0\nEsto también quitará todo el $mediaType de tu biblioteca.\n\nNota: Los archivos en sí no se borrarán.'; + } + + @override + String get chapter => 'capítulo'; + + @override + String get episode => 'episodio'; + @override String get unread_count => 'Cuenta de no leídos'; @@ -1525,6 +1549,30 @@ class AppLocalizationsEs419 extends AppLocalizationsEs { @override String get last_update_check => 'Última verificación de actualización'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Estás borrando los $count $entryTypePlural de este $mediaType de tu biblioteca.', + one: + 'Estás borrando el único $entryType de este $mediaType de tu biblioteca.', + ); + return '$_temp0\nEsto también quitará todo el $mediaType de tu biblioteca.\n\nNota: Los archivos en sí no se borrarán.'; + } + + @override + String get chapter => 'capítulo'; + + @override + String get episode => 'episodio'; + @override String get unread_count => 'Cuenta de no leídos'; diff --git a/lib/l10n/generated/app_localizations_fr.dart b/lib/l10n/generated/app_localizations_fr.dart index d0553b03..13cbb45b 100644 --- a/lib/l10n/generated/app_localizations_fr.dart +++ b/lib/l10n/generated/app_localizations_fr.dart @@ -65,6 +65,30 @@ class AppLocalizationsFr extends AppLocalizations { @override String get last_update_check => 'Dernière mise à jour'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Tu es en train de supprimer les $count $entryTypePlural de ce $mediaType de ta bibliothèque.', + one: + 'Tu es en train de supprimer le seul $entryType de ce $mediaType de ta bibliothèque.', + ); + return '$_temp0\nÇa va aussi supprimer tout le $mediaType de ta bibliothèque.\n\nNote : Les fichiers ne seront pas supprimés.'; + } + + @override + String get chapter => 'chapitre'; + + @override + String get episode => 'épisode'; + @override String get unread_count => 'Nombre de non-lus'; diff --git a/lib/l10n/generated/app_localizations_id.dart b/lib/l10n/generated/app_localizations_id.dart index eb99da6b..d9b11353 100644 --- a/lib/l10n/generated/app_localizations_id.dart +++ b/lib/l10n/generated/app_localizations_id.dart @@ -65,6 +65,30 @@ class AppLocalizationsId extends AppLocalizations { @override String get last_update_check => 'Pemeriksaan Pembaruan Terakhir'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Kamu sedang menghapus semua $count $entryTypePlural dari $mediaType ini di perpustakaan kamu.', + one: + 'Kamu sedang menghapus satu-satunya $entryType dari $mediaType ini di perpustakaan kamu.', + ); + return '$_temp0\nIni juga akan menghapus seluruh $mediaType dari perpustakaanmu.\n\nCatatan: File-nya sendiri tidak akan dihapus.'; + } + + @override + String get chapter => 'bab'; + + @override + String get episode => 'episode'; + @override String get unread_count => 'Jumlah Belum Dibaca'; diff --git a/lib/l10n/generated/app_localizations_it.dart b/lib/l10n/generated/app_localizations_it.dart index 0232b2ee..8f5a5d62 100644 --- a/lib/l10n/generated/app_localizations_it.dart +++ b/lib/l10n/generated/app_localizations_it.dart @@ -65,6 +65,30 @@ class AppLocalizationsIt extends AppLocalizations { @override String get last_update_check => 'Ultimo controllo aggiornamenti'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Stai eliminando tutti e $count $entryTypePlural di questo $mediaType dalla tua libreria.', + one: + 'Stai eliminando l’unico $entryType di questo $mediaType dalla tua libreria.', + ); + return '$_temp0\nQuesto rimuoverà anche tutto il $mediaType dalla tua libreria.\n\nNota: I file non saranno eliminati.'; + } + + @override + String get chapter => 'capitolo'; + + @override + String get episode => 'episodio'; + @override String get unread_count => 'Conteggio non letti'; diff --git a/lib/l10n/generated/app_localizations_pt.dart b/lib/l10n/generated/app_localizations_pt.dart index 014e787d..1a498982 100644 --- a/lib/l10n/generated/app_localizations_pt.dart +++ b/lib/l10n/generated/app_localizations_pt.dart @@ -65,6 +65,30 @@ class AppLocalizationsPt extends AppLocalizations { @override String get last_update_check => 'Última verificação de atualização'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Estás a eliminar todos os $count $entryTypePlural deste $mediaType da tua biblioteca.', + one: + 'Estás a eliminar o único $entryType deste $mediaType da tua biblioteca.', + ); + return '$_temp0\nIsto vai também remover todo o $mediaType da tua biblioteca.\n\nNota: Os ficheiros em si não vão ser eliminados.'; + } + + @override + String get chapter => 'capítulo'; + + @override + String get episode => 'episódio'; + @override String get unread_count => 'Contagem de não lidos'; @@ -1522,6 +1546,30 @@ class AppLocalizationsPtBr extends AppLocalizationsPt { @override String get last_update_check => 'Última verificação de atualização'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Você está deletando todos os $count $entryTypePlural deste $mediaType da sua biblioteca.', + one: + 'Você está deletando o único $entryType deste $mediaType da sua biblioteca.', + ); + return '$_temp0\nIsso também vai remover todo o $mediaType da sua biblioteca.\n\nObs: Os arquivos em si não serão deletados.'; + } + + @override + String get chapter => 'capítulo'; + + @override + String get episode => 'episódio'; + @override String get unread_count => 'Contagem de não lidos'; diff --git a/lib/l10n/generated/app_localizations_ru.dart b/lib/l10n/generated/app_localizations_ru.dart index 928e3d59..6224f68e 100644 --- a/lib/l10n/generated/app_localizations_ru.dart +++ b/lib/l10n/generated/app_localizations_ru.dart @@ -65,6 +65,30 @@ class AppLocalizationsRu extends AppLocalizations { @override String get last_update_check => 'Последняя проверка обновлений'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Ты удаляешь все $count $entryTypePlural этого $mediaType из библиотеки.', + one: + 'Ты удаляешь единственный $entryType этого $mediaType из библиотеки.', + ); + return '$_temp0\nЭто также удалит весь $mediaType из твоей библиотеки.\n\nПримечание: Сами файлы удалены не будут.'; + } + + @override + String get chapter => 'глава'; + + @override + String get episode => 'эпизод'; + @override String get unread_count => 'Количество непрочитанных'; diff --git a/lib/l10n/generated/app_localizations_th.dart b/lib/l10n/generated/app_localizations_th.dart index 721bb7ae..e0a2963c 100644 --- a/lib/l10n/generated/app_localizations_th.dart +++ b/lib/l10n/generated/app_localizations_th.dart @@ -65,6 +65,29 @@ class AppLocalizationsTh extends AppLocalizations { @override String get last_update_check => 'ตรวจการอัพเดท'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'คุณกำลังลบทั้งหมด $count $entryTypePluralของ$mediaTypeนี้ออกจากคลังของคุณ', + one: 'คุณกำลังลบ$entryTypeเดียวของ$mediaTypeนี้ออกจากคลังของคุณ', + ); + return '$_temp0\nสิ่งนี้จะลบ$mediaTypeทั้งหมดออกจากคลังของคุณด้วย\n\nหมายเหตุ: ไฟล์จะไม่ถูกลบ'; + } + + @override + String get chapter => 'บท'; + + @override + String get episode => 'ตอน'; + @override String get unread_count => 'ที่ยังไม่อ่าน'; diff --git a/lib/l10n/generated/app_localizations_tr.dart b/lib/l10n/generated/app_localizations_tr.dart index 95f55028..3b91923f 100644 --- a/lib/l10n/generated/app_localizations_tr.dart +++ b/lib/l10n/generated/app_localizations_tr.dart @@ -65,6 +65,29 @@ class AppLocalizationsTr extends AppLocalizations { @override String get last_update_check => 'Son Güncelleme Kontrolü'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: + 'Kitaplığından bu $mediaType’nin tüm $count $entryTypePlural’ini siliyorsun.', + one: 'Kitaplığından bu $mediaType’nin tek $entryType’ünü siliyorsun.', + ); + return '$_temp0\nBu işlem $mediaType’nin tamamını da kütüphanenden kaldıracak.\n\nNot: Dosyalar silinmeyecek.'; + } + + @override + String get chapter => 'bölüm'; + + @override + String get episode => 'bölüm'; + @override String get unread_count => 'Okunmamış Sayısı'; diff --git a/lib/l10n/generated/app_localizations_zh.dart b/lib/l10n/generated/app_localizations_zh.dart index 26bfb30a..a4c749e0 100644 --- a/lib/l10n/generated/app_localizations_zh.dart +++ b/lib/l10n/generated/app_localizations_zh.dart @@ -65,6 +65,28 @@ class AppLocalizationsZh extends AppLocalizations { @override String get last_update_check => '最后更新检查'; + @override + String last_entry_delete_warning( + num count, + Object entryType, + Object entryTypePlural, + Object mediaType, + ) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '你正在从你的库中删除此$mediaType的全部$count$entryTypePlural。', + one: '你正在从你的库中删除此$mediaType的唯一$entryType。', + ); + return '$_temp0\n这也会将整个$mediaType从你的库中移除。\n\n注意:文件本身不会被删除。'; + } + + @override + String get chapter => '章节'; + + @override + String get episode => '剧集'; + @override String get unread_count => '未读计数'; diff --git a/lib/modules/manga/detail/manga_detail_view.dart b/lib/modules/manga/detail/manga_detail_view.dart index f496facb..ef114c8f 100644 --- a/lib/modules/manga/detail/manga_detail_view.dart +++ b/lib/modules/manga/detail/manga_detail_view.dart @@ -1045,11 +1045,56 @@ class _MangaDetailViewState extends ConsumerState shadowColor: Colors.transparent, ), onPressed: () { + final selectedChapters = ref.watch( + chaptersListStateProvider, + ); + final totalChapters = + widget.manga!.chapters.length; + final isLastChapters = + selectedChapters.length == totalChapters; + final isAnime = widget.itemType == ItemType.anime; + final entryType = isAnime + ? l10n.episode + : l10n.chapter; + final pluralEntryType = isAnime + ? l10n.episodes + : l10n.chapters; + final mediaType = isAnime + ? l10n.anime + : l10n.manga; + final warningMessage = l10n + .last_entry_delete_warning( + totalChapters, + entryType, + pluralEntryType, + mediaType, + ); showDialog( context: context, builder: (context) { return AlertDialog( title: Text(l10n.delete_chapters), + content: isLastChapters + ? Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Icon( + Icons.warning_amber_rounded, + color: Colors.orange, + ), + const SizedBox(width: 12), + Expanded( + child: Text( + warningMessage, + style: TextStyle( + color: Colors.red, + ), + ), + ), + ], + ) + : null, actions: [ Row( mainAxisAlignment: @@ -1064,15 +1109,19 @@ class _MangaDetailViewState extends ConsumerState const SizedBox(width: 15), TextButton( onPressed: () async { - isar.writeTxnSync(() { - for (var chapter in ref.watch( - chaptersListStateProvider, - )) { - isar.chapters.deleteSync( - chapter.id!, - ); - } + final navigator = Navigator.of( + context, + ); + await isar.writeTxn(() async { + final idsToDelete = + selectedChapters + .map((c) => c.id!) + .toList(); + await isar.chapters.deleteAll( + idsToDelete, + ); }); + if (!mounted) return; ref .read( isLongPressedStateProvider @@ -1085,8 +1134,21 @@ class _MangaDetailViewState extends ConsumerState .notifier, ) .clear(); - if (mounted) { - Navigator.pop(context); + navigator.pop(); + if (isLastChapters) { + navigator.pop(); + Future.delayed( + const Duration( + milliseconds: 350, + ), + () { + isar.writeTxn( + () => isar.mangas.delete( + widget.manga!.id!, + ), + ); + }, + ); } }, child: Text(l10n.delete),