Magical Translators: add Spanish language (#10800)

This commit is contained in:
qtcomput3 2022-02-12 06:09:58 -06:00 committed by GitHub
parent 3b3bd91481
commit f47efdf9ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import okhttp3.Response
class MagicalTranslatorsFactory : SourceFactory {
override fun createSources() = listOf(
MagicalTranslatorsEN(),
MagicalTranslatorsES(),
MagicalTranslatorsPL(),
)
}
@ -35,7 +36,13 @@ abstract class MagicalTranslatorsCommon(lang: String) :
class MagicalTranslatorsEN : MagicalTranslatorsCommon("en") {
override fun filterMangasPage(mangasPage: MangasPage): MangasPage = mangasPage.copy(
mangas = mangasPage.mangas.filterNot { it.url.endsWith("-PL") }
mangas = mangasPage.mangas.filterNot { it.url.endsWith("-ES") || it.url.endsWith("-PL") }
)
}
class MagicalTranslatorsES : MagicalTranslatorsCommon("es") {
override fun filterMangasPage(mangasPage: MangasPage): MangasPage = mangasPage.copy(
mangas = mangasPage.mangas.filter { it.url.endsWith("-ES") }
)
}

View File

@ -16,7 +16,8 @@ class GuyaGenerator : ThemeSourceGenerator {
SingleLang("Guya", "https://guya.moe", "en", overrideVersionCode = 18),
SingleLang("Danke fürs Lesen", "https://danke.moe", "en", className = "DankeFursLesen"),
SingleLang("Hachirumi", "https://hachirumi.com", "en", isNsfw = true),
MultiLang("Magical Translators", "https://mahoushoujobu.com", listOf("en", "pl")),
MultiLang("Magical Translators", "https://mahoushoujobu.com", listOf("en", "es", "pl"),
overrideVersionCode = 1),
)
companion object {
@JvmStatic