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

@ -45,6 +45,7 @@ import com.keylesspalace.tusky.entity.StatusContext
import com.keylesspalace.tusky.entity.StatusEdit
import com.keylesspalace.tusky.entity.StatusSource
import com.keylesspalace.tusky.entity.TimelineAccount
import com.keylesspalace.tusky.entity.Translation
import com.keylesspalace.tusky.entity.TrendingTag
import okhttp3.MultipartBody
import okhttp3.RequestBody
@ -703,4 +704,11 @@ interface MastodonApi {
@Query("limit") limit: Int? = null,
@Query("offset") offset: String? = null
): Response<List<Status>>
@FormUrlEncoded
@POST("api/v1/statuses/{id}/translate")
suspend fun translate(
@Path("id") statusId: String,
@Field("lang") targetLanguage: String?
): NetworkResult<Translation>
}