Add French to Bilibili Comics (#13515)

* Add French to Bilibili Comics.

* Add missing translations.
This commit is contained in:
Alessandro Jean 2022-09-19 16:27:23 -03:00 committed by GitHub
parent ebe881ee51
commit 5d8b98f369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 3 deletions

View File

@ -25,6 +25,7 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okhttp3.internal.closeQuietly
import okio.Buffer
import java.io.IOException
import java.net.URLDecoder
@ -34,7 +35,8 @@ class BilibiliComicsFactory : SourceFactory {
BilibiliComicsEn(),
BilibiliComicsCn(),
BilibiliComicsId(),
BilibiliComicsEs()
BilibiliComicsEs(),
BilibiliComicsFr(),
)
}
@ -207,6 +209,7 @@ abstract class BilibiliComics(lang: String) : Bilibili(
val refreshTokenResponse = chain.proceed(refreshTokenRequest)
accessTokenCookie = refreshTokenParse(refreshTokenResponse)
refreshTokenResponse.closeQuietly()
request = request.newBuilder()
.header("Authorization", "Bearer ${accessTokenCookie!!.accessToken}")
@ -355,3 +358,18 @@ class BilibiliComicsEs : BilibiliComics(BilibiliIntl.SPANISH) {
BilibiliTag("Wuxia", 103)
)
}
class BilibiliComicsFr : BilibiliComics(BilibiliIntl.FRENCH) {
override fun getAllGenres(): Array<BilibiliTag> = arrayOf(
BilibiliTag("Tout", -1),
BilibiliTag("BL", 3),
BilibiliTag("Science Fiction", 8),
BilibiliTag("Historique", 12),
BilibiliTag("Romance", 13),
BilibiliTag("GL", 16),
BilibiliTag("Fantasy Orientale", 30),
BilibiliTag("Suspense", 41),
BilibiliTag("Moderne", 111)
)
}

View File

@ -16,9 +16,9 @@ class BilibiliGenerator : ThemeSourceGenerator {
MultiLang(
name = "BILIBILI COMICS",
baseUrl = "https://www.bilibilicomics.com",
langs = listOf("en", "zh-Hans", "id", "es"),
langs = listOf("en", "zh-Hans", "id", "es", "fr"),
className = "BilibiliComicsFactory",
overrideVersionCode = 1
overrideVersionCode = 2
),
SingleLang(
name = "BILIBILI MANGA",

View File

@ -83,6 +83,7 @@ class BilibiliIntl(lang: String) {
CHINESE, SIMPLIFIED_CHINESE -> "人气推荐"
INDONESIAN -> "Populer"
SPANISH -> "Popularidad"
FRENCH -> "Préférences"
else -> "Popular"
}
@ -90,6 +91,7 @@ class BilibiliIntl(lang: String) {
CHINESE, SIMPLIFIED_CHINESE -> "更新时间"
INDONESIAN -> "Terbaru"
SPANISH -> "Actualización"
FRENCH -> "Récent"
else -> "Updated"
}
@ -107,6 +109,7 @@ class BilibiliIntl(lang: String) {
CHINESE, SIMPLIFIED_CHINESE -> "全部"
INDONESIAN -> "Semua"
SPANISH -> "Todos"
FRENCH -> "Tout"
else -> "All"
}
@ -114,6 +117,7 @@ class BilibiliIntl(lang: String) {
CHINESE, SIMPLIFIED_CHINESE -> "连载中"
INDONESIAN -> "Berlangsung"
SPANISH -> "En curso"
FRENCH -> "En cours"
else -> "Ongoing"
}
@ -121,6 +125,7 @@ class BilibiliIntl(lang: String) {
CHINESE, SIMPLIFIED_CHINESE -> "已完结"
INDONESIAN -> "Tamat"
SPANISH -> "Finalizado"
FRENCH -> "Complet"
else -> "Completed"
}
@ -168,5 +173,6 @@ class BilibiliIntl(lang: String) {
const val INDONESIAN = "id"
const val SIMPLIFIED_CHINESE = "zh-Hans"
const val SPANISH = "es"
const val FRENCH = "fr"
}
}