Add language dropdown to compose view (#2651)

* Add UI for selecting post language

* Apply selected language when sending status

* Save/restore post language with drafts

* Fall back to english if the configured language isn't found in the locale list (no-NB)

* Remove comment about no_NB

* Move language dropdown to top of compose view

* Preserve language when redrafting

* Set default language to target post's language when replying

* Add Tusky license header to new source file

* Tweak language dropdown button width
This commit is contained in:
Levi Bard 2022-08-31 18:53:57 +02:00 committed by GitHub
commit 0041acf2d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 1140 additions and 28 deletions

View file

@ -94,7 +94,8 @@ data class ConversationStatusEntity(
val expanded: Boolean,
val collapsed: Boolean,
val muted: Boolean,
val poll: Poll?
val poll: Poll?,
val language: String?,
) {
fun toViewData(): StatusViewData.Concrete {
@ -125,7 +126,8 @@ data class ConversationStatusEntity(
pinned = false,
muted = muted,
poll = poll,
card = null
card = null,
language = language,
),
isExpanded = expanded,
isShowingContent = showingHiddenContent,
@ -167,7 +169,8 @@ fun Status.toEntity() =
expanded = false,
collapsed = true,
muted = muted ?: false,
poll = poll
poll = poll,
language = language,
)
fun Conversation.toEntity(accountId: Long, order: Int) =

View file

@ -85,6 +85,7 @@ fun StatusViewData.Concrete.toConversationStatusEntity(
expanded = expanded,
collapsed = collapsed,
muted = muted,
poll = poll
poll = poll,
language = status.language,
)
}