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

@ -27,7 +27,8 @@ data class DeletedStatus(
val sensitive: Boolean,
@SerializedName("media_attachments") var attachments: ArrayList<Attachment>?,
val poll: Poll?,
@SerializedName("created_at") val createdAt: Date
@SerializedName("created_at") val createdAt: Date,
val language: String?,
) {
fun isEmpty(): Boolean {
return text == null && attachments == null

View file

@ -27,7 +27,8 @@ data class NewStatus(
val sensitive: Boolean,
@SerializedName("media_ids") val mediaIds: List<String>?,
@SerializedName("scheduled_at") val scheduledAt: String?,
val poll: NewPoll?
val poll: NewPoll?,
val language: String?,
)
@Parcelize

View file

@ -48,7 +48,8 @@ data class Status(
val pinned: Boolean?,
val muted: Boolean?,
val poll: Poll?,
val card: Card?
val card: Card?,
val language: String?,
) {
val actionableId: String
@ -130,7 +131,8 @@ data class Status(
sensitive = sensitive,
attachments = attachments,
poll = poll,
createdAt = createdAt
createdAt = createdAt,
language = language,
)
}