Skip to content

Commit

Permalink
feat: Translate statuses on cached timelines (#220)
Browse files Browse the repository at this point in the history
Implement some support for server-side status translation. Do this by:

- Implement support for the `api/v1/instance` endpoint to determine if
  the remote server supports translation.

- Create new `ServerCapabilities` to allow the app to query the remote
  capabilities in a server-agnostic way. Use this to query if the
  remote server supports the Mastodon implementation of server-side
  translation

- If translation is supported then show a translate/undo translate
  option on the status "..." menu.

- Fetch translated content from the server if requested, and store it
  locally as a new Room entity.

- Update displaying a status to check if the translated version
  should be displayed; if it should then new code is used to show
  translated content, content warning, poll options, and media
  descriptions.

- Add a `TextView` to show an "in progress" message while translation
  is happening, and to show the translation provider (generally
  required by agreements with them).

Partially fixes #62

---------

Co-authored-by: sanao <naosak1006@gmail.com>
  • Loading branch information
nikclayton and sanao1006 authored Nov 12, 2023
1 parent 27367d9 commit d40b87f
Show file tree
Hide file tree
Showing 55 changed files with 2,634 additions and 341 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ dependencies {
googleImplementation libs.app.update
googleImplementation libs.app.update.ktx

implementation libs.kotlin.result
implementation libs.semver

testImplementation libs.androidx.test.junit
testImplementation libs.robolectric
testImplementation libs.bundles.mockito
Expand Down
Loading

0 comments on commit d40b87f

Please sign in to comment.