Translate some missing strings on MangaDex (#16841)

* Translate some missing strings on MangaDex.

* Use bullet points in the list.
This commit is contained in:
Alessandro Jean 2023-06-23 17:36:03 -03:00 committed by GitHub
parent c45a9a0daa
commit c0e01e8dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 180
extVersionCode = 181
isNsfw = true
}

View File

@ -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()
}
}

View File

@ -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 {