From c0e01e8dace980f86dcc5f4f5d7962522b4097b4 Mon Sep 17 00:00:00 2001 From: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> Date: Fri, 23 Jun 2023 17:36:03 -0300 Subject: [PATCH] Translate some missing strings on MangaDex (#16841) * Translate some missing strings on MangaDex. * Use bullet points in the list. --- src/all/mangadex/build.gradle | 2 +- .../extension/all/mangadex/MangaDexHelper.kt | 10 +++++++--- .../tachiyomi/extension/all/mangadex/MangaDexIntl.kt | 12 ++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 581a2e4a8..cfdda1e0e 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaDex' pkgNameSuffix = 'all.mangadex' extClass = '.MangaDexFactory' - extVersionCode = 180 + extVersionCode = 181 isNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt index a6afba34e..60234e8ae 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt @@ -335,14 +335,18 @@ class MangaDexHelper(lang: String) { val genreList = MDConstants.tagGroupsOrder.flatMap { genresMap[it].orEmpty() } + nonGenres - var desc = (attr.description[lang] ?: attr.description["en"] ?: "").removeEntitiesAndMarkdown() + var desc = (attr.description[lang] ?: attr.description["en"])?.removeEntitiesAndMarkdown() ?: "" if (altTitlesInDesc) { val romanizedOriginalLang = MDConstants.romanizedLangCodes[attr.originalLanguage] ?: "" - val altTitles = attr.altTitles.filter { it.containsKey(lang) || it.containsKey(romanizedOriginalLang) } + val altTitles = attr.altTitles + .filter { it.containsKey(lang) || it.containsKey(romanizedOriginalLang) } .mapNotNull { it.values.singleOrNull() } + .filter(String::isNotEmpty) + if (altTitles.isNotEmpty()) { - val altTitlesDesc = intl.altTitleText + altTitles.joinToString("\n", "\n") + val altTitlesDesc = altTitles + .joinToString("\n", "${intl.altTitleText}\n") { "• $it" } desc += (if (desc.isNullOrBlank()) "" else "\n\n") + altTitlesDesc.removeEntitiesAndMarkdown() } } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt index 03183eb3f..4a91a3b68 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexIntl.kt @@ -268,14 +268,14 @@ class MangaDexIntl(lang: String) { } val altTitlesInDesc: String = when (availableLang) { - // TODO add other languages + BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Títulos alternativos na descrição" else -> "Alternative titles in description" } val altTitlesInDescSummary: String = when (availableLang) { - // TODO add other languages - else -> - "Include a manga's alternative titles at the end of its description" + BRAZILIAN_PORTUGUESE, PORTUGUESE -> + "Inclui os títulos alternativos das séries no final de cada descrição" + else -> "Include a manga's alternative titles at the end of its description" } val tryUsingFirstVolumeCover: String = when (availableLang) { @@ -1020,8 +1020,8 @@ class MangaDexIntl(lang: String) { } val altTitleText: String = when (availableLang) { - // TODO fill in other languages - else -> "Alternative Titles:" + BRAZILIAN_PORTUGUESE, PORTUGUESE -> "Títulos alternativos:" + else -> "Alternative titles:" } companion object {