chore(settings): Always display App Language text in settings (#1122)
* chore(settings): Add App language text all the time * spotless * English variants
This commit is contained in:
parent
c41d5fb847
commit
58eccf9ddb
1 changed files with 8 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package eu.kanade.presentation.more.settings.screen
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.ReadOnlyComposable
|
||||
|
|
@ -37,6 +38,7 @@ import uy.kohesive.injekt.api.get
|
|||
import java.time.LocalDate
|
||||
|
||||
object SettingsAppearanceScreen : SearchableSettings {
|
||||
@Suppress("unused")
|
||||
private fun readResolve(): Any = SettingsAppearanceScreen
|
||||
|
||||
@ReadOnlyComposable
|
||||
|
|
@ -128,7 +130,6 @@ object SettingsAppearanceScreen : SearchableSettings {
|
|||
stringResource(KMR.strings.pref_theme_cover_based_style_fidelity)
|
||||
PaletteStyle.Content ->
|
||||
stringResource(KMR.strings.pref_theme_cover_based_style_content)
|
||||
else -> it.name
|
||||
}
|
||||
}
|
||||
.toImmutableMap(),
|
||||
|
|
@ -192,7 +193,6 @@ object SettingsAppearanceScreen : SearchableSettings {
|
|||
stringResource(KMR.strings.pref_theme_cover_based_style_fidelity)
|
||||
PaletteStyle.Content ->
|
||||
stringResource(KMR.strings.pref_theme_cover_based_style_content)
|
||||
else -> it.name
|
||||
}
|
||||
}
|
||||
.toImmutableMap(),
|
||||
|
|
@ -228,11 +228,16 @@ object SettingsAppearanceScreen : SearchableSettings {
|
|||
UiPreferences.dateFormat(dateFormat).format(now)
|
||||
}
|
||||
|
||||
val currentLanguage = remember {
|
||||
AppCompatDelegate.getApplicationLocales().get(0)?.toLanguageTag() ?: ""
|
||||
}
|
||||
|
||||
return Preference.PreferenceGroup(
|
||||
title = stringResource(MR.strings.pref_category_display),
|
||||
preferenceItems = persistentListOf(
|
||||
Preference.PreferenceItem.TextPreference(
|
||||
title = stringResource(MR.strings.pref_app_language),
|
||||
title = stringResource(MR.strings.pref_app_language) +
|
||||
if (currentLanguage.isNotEmpty() && !currentLanguage.startsWith("en")) " (App Language)" else "",
|
||||
onClick = { navigator.push(AppLanguageScreen()) },
|
||||
),
|
||||
Preference.PreferenceItem.ListPreference(
|
||||
|
|
|
|||
Loading…
Reference in a new issue