Machine translation of posts (#4307)

This commit is contained in:
Willow 2024-03-09 16:12:18 +01:00 committed by GitHub
commit fbb22799dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1912 additions and 180 deletions

View file

@ -49,8 +49,11 @@ data class Status(
val pinned: Boolean?,
val muted: Boolean?,
val poll: Poll?,
/** Preview card for links included within status content. */
val card: Card?,
/** ISO 639 language code for this status. */
val language: String?,
/** If the current token has an authorized user: The filter and keywords that matched this status. */
val filtered: List<FilterResult>?
) {

View file

@ -0,0 +1,25 @@
package com.keylesspalace.tusky.entity
import com.google.gson.annotations.SerializedName
data class MediaTranslation(
val id: String,
val description: String,
)
/**
* Represents the result of machine translating some status content.
*
* See [doc](https://docs.joinmastodon.org/entities/Translation/).
*/
data class Translation(
val content: String,
@SerializedName("spoiler_warning")
val spoilerWarning: String?,
val poll: List<String>?,
@SerializedName("media_attachments")
val mediaAttachments: List<MediaTranslation>,
@SerializedName("detected_source_language")
val detectedSourceLanguage: String,
val provider: String,
)