From 31e563c9ab2b7143f1d3796bbf11fcc9aa62ff04 Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Sun, 24 Oct 2021 14:39:21 -0300 Subject: [PATCH] Fix wrong language in originalLanguage tag. (#9600) --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDexHelper.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 854de00ba..c54a972cd 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 = 140 + extVersionCode = 141 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 30b5a17c4..7a4d4567e 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 @@ -183,8 +183,8 @@ class MangaDexHelper() { val altTitle = it.asMdMap() altTitle[lang] ?: altTitle["en"] != null }?.asMdMap()?.values?.singleOrNull() - ?: titleMap["ja"] // romaji titles are sometimes ja (and are not altTitles) - ?: titleMap.values.firstOrNull() // use literally anything from title as a last resort + ?: titleMap["ja"] // romaji titles are sometimes ja (and are not altTitles) + ?: titleMap.values.firstOrNull() // use literally anything from title as a last resort title = cleanString(dirtyTitle ?: "") coverFileName?.let { @@ -213,10 +213,14 @@ class MangaDexHelper() { "Content rating: " + tempContentRating.capitalize(Locale.US) } + val dexLocale = Locale.forLanguageTag(lang) + val nonGenres = listOf( (attr.publicationDemographic ?: "").capitalize(Locale.US), contentRating, - Locale(attr.originalLanguage ?: "").displayLanguage + Locale(attr.originalLanguage ?: "") + .getDisplayLanguage(dexLocale) + .capitalize(dexLocale) ) val authors = mangaDataDto.relationships.filter { relationshipDto ->