Support configuring interface language per user (#1406)
## Description Adds a setting to configure the app's language/locale. It is configured per user. This settings has no impact on audio or subtitles language choices. Only languages Wholphin has translations for can be used. If you would like to contribute new translations, check out https://translate.codeberg.org/projects/wholphin/! Dev notes: This doesn't exactly follow Android's recommendations because the [guidelines are for per-app](https://developer.android.com/guide/topics/resources/app-languages) and not users within the app. ### Related issues Closes #513 Closes #669 ### Testing - Emulator API 34 - Nvidia shield API 30 - Fire TV OS 7 API 28 ## Screenshots <img width="1280" height="720" alt="language Large" src="https://github.com/user-attachments/assets/bf1c0962-8a36-4012-aed9-eab564fc1114" /> ## AI or LLM usage None
This commit is contained in:
parent
625cdcb4a3
commit
903c45dfb8
43 changed files with 1501 additions and 418 deletions
|
|
@ -3,6 +3,7 @@ package com.github.damontecres.wholphin.util
|
|||
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||
import com.github.damontecres.wholphin.data.model.HomeRowConfig
|
||||
import com.github.damontecres.wholphin.data.model.HomeRowViewOptions
|
||||
import com.github.damontecres.wholphin.ui.util.StringProvider
|
||||
|
||||
/**
|
||||
* Generic state for loading something from the API
|
||||
|
|
@ -48,28 +49,28 @@ sealed interface RowLoadingState {
|
|||
}
|
||||
|
||||
sealed interface HomeRowLoadingState {
|
||||
val title: String
|
||||
val title: StringProvider
|
||||
|
||||
val completed: Boolean
|
||||
get() = this is Success || this is Error
|
||||
|
||||
data class Pending(
|
||||
override val title: String,
|
||||
override val title: StringProvider,
|
||||
) : HomeRowLoadingState
|
||||
|
||||
data class Loading(
|
||||
override val title: String,
|
||||
override val title: StringProvider,
|
||||
) : HomeRowLoadingState
|
||||
|
||||
data class Success(
|
||||
override val title: String,
|
||||
override val title: StringProvider,
|
||||
val items: List<BaseItem?>,
|
||||
val viewOptions: HomeRowViewOptions = HomeRowViewOptions(),
|
||||
val rowType: HomeRowConfig? = null,
|
||||
) : HomeRowLoadingState
|
||||
|
||||
data class Error(
|
||||
override val title: String,
|
||||
override val title: StringProvider,
|
||||
val message: String? = null,
|
||||
val exception: Throwable? = null,
|
||||
) : HomeRowLoadingState {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue