From 3ce4e729f9f9e964879889eb6106398c654db123 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Sat, 17 Feb 2024 09:39:38 -0500 Subject: [PATCH] MMRCMS: Fix search and add Spanish translations (#1333) Fix search and add (es) translations --- lib-multisrc/mmrcms/assets/i18n/messages_es.properties | 10 ++++++++++ lib-multisrc/mmrcms/build.gradle.kts | 2 +- .../src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt | 5 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 lib-multisrc/mmrcms/assets/i18n/messages_es.properties diff --git a/lib-multisrc/mmrcms/assets/i18n/messages_es.properties b/lib-multisrc/mmrcms/assets/i18n/messages_es.properties new file mode 100644 index 000000000..caaad7b53 --- /dev/null +++ b/lib-multisrc/mmrcms/assets/i18n/messages_es.properties @@ -0,0 +1,10 @@ +filter_warning=Ignorados si se realiza una búsqueda textual +filter_missing_warning=Presione 'Restablecer' para intentar mostrar los filtros +category_filter_title=Categoría +status_filter_title=Estado +type_filter_title=Tipo +year_filter_title=Año de lanzamiento +author_filter_title=Autor +tag_filter_title=Etiqueta +title_begins_with_filter_title=El título comienza con +sort_by_filter_title=Ordenar por diff --git a/lib-multisrc/mmrcms/build.gradle.kts b/lib-multisrc/mmrcms/build.gradle.kts index 0ce8d2e28..0f73d06ae 100644 --- a/lib-multisrc/mmrcms/build.gradle.kts +++ b/lib-multisrc/mmrcms/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("lib-multisrc") } -baseVersionCode = 10 +baseVersionCode = 11 dependencies { api(project(":lib:i18n")) diff --git a/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt b/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt index 641df3a48..708b02543 100644 --- a/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt +++ b/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt @@ -32,6 +32,7 @@ import uy.kohesive.injekt.injectLazy import java.text.ParseException import java.text.SimpleDateFormat import java.util.Locale +import kotlin.math.min /** * @param dateFormat The date format used for parsing chapter dates. @@ -73,7 +74,7 @@ constructor( protected val intl = Intl( lang, - setOf("en"), + setOf("en", "es"), "en", this::class.java.classLoader!!, ) @@ -208,7 +209,7 @@ constructor( override fun searchMangaNextPageSelector(): String? = ".pagination a[rel=next]" protected fun parseSearchDirectory(page: Int): MangasPage { - val manga = searchDirectory.subList((page - 1) * 24, page * 24) + val manga = searchDirectory.subList((page - 1) * 24, min(page * 24, searchDirectory.size)) .map { SManga.create().apply { url = "/$itemPath/${it.data}"