Language add to extensions (#52)
* got rid of both companion object * minor changes * It Now show lang on extensions * fixed * quickfix * android locale tuning * toggle option to setting * some fixes added 2 fonts removed Scanlators for anime --------- Co-authored-by: rebelonion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
parent
c310bea0e9
commit
75895d851f
22 changed files with 192 additions and 89 deletions
|
@ -12,8 +12,7 @@ class LangSet {
|
|||
companion object{
|
||||
fun setLocale(activity: Activity) {
|
||||
val useCursedLang = activity.getSharedPreferences("Dantotsu", Activity.MODE_PRIVATE).getBoolean("use_cursed_lang", false)
|
||||
if(!useCursedLang) return
|
||||
val locale = Locale("en", "rDW")
|
||||
val locale = if(useCursedLang) Locale("en", "DW") else Locale("en", "US")
|
||||
Locale.setDefault(locale)
|
||||
val resources: Resources = activity.resources
|
||||
val config: Configuration = resources.configuration
|
||||
|
|
32
app/src/main/java/ani/dantotsu/others/LanguageMapper.kt
Normal file
32
app/src/main/java/ani/dantotsu/others/LanguageMapper.kt
Normal file
|
@ -0,0 +1,32 @@
|
|||
package ani.dantotsu.others
|
||||
|
||||
class LanguageMapper {
|
||||
companion object {
|
||||
|
||||
fun mapLanguageCodeToName(code: String): String {
|
||||
return when (code) {
|
||||
"all" -> "Multi"
|
||||
"ar" -> "Arabic"
|
||||
"de" -> "German"
|
||||
"en" -> "English"
|
||||
"es" -> "Spanish"
|
||||
"fr" -> "French"
|
||||
"id" -> "Indonesian"
|
||||
"it" -> "Italian"
|
||||
"ja" -> "Japanese"
|
||||
"ko" -> "Korean"
|
||||
"pl" -> "Polish"
|
||||
"pt-BR" -> "Portuguese (Brazil)"
|
||||
"ru" -> "Russian"
|
||||
"th" -> "Thai"
|
||||
"tr" -> "Turkish"
|
||||
"uk" -> "Ukrainian"
|
||||
"vi" -> "Vietnamese"
|
||||
"zh" -> "Chinese"
|
||||
"zh-Hans" -> "Chinese (Simplified)"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue