Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translations via mastodon api #3228

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
lint
  • Loading branch information
Joshix-1 committed Jan 28, 2023
commit 9ca7a8e3c9cab3ccce37db20571207e88dd04325
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.entity.TimelineAccount
import com.keylesspalace.tusky.entity.TranslationResult
import com.keylesspalace.tusky.viewdata.StatusViewData
import java.util.*
import java.util.Date

@Entity(primaryKeys = ["id", "accountId"])
@TypeConverters(Converters::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,13 @@ class SearchViewModel @Inject constructor(
if (alreadyTranslated)
return timelineCases.dispatchNullTranslation(statusViewData.actionableId)
timelineCases.translate(statusViewData.actionableId)
.onErrorReturnItem(TranslationResult(
statusViewData.status.content,
statusViewData.status.language ?: "null",
"<error>"
))
.onErrorReturnItem(
TranslationResult(
statusViewData.status.content,
statusViewData.status.language ?: "null",
"<error>",
)
)
.subscribe()
.autoDispose()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.keylesspalace.tusky.entity.Poll
import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.entity.TimelineAccount
import com.keylesspalace.tusky.viewdata.StatusViewData
import java.util.*
import java.util.Date

private const val TAG = "TimelineTypeMappers"

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/keylesspalace/tusky/db/Converters.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.entity.TranslationResult
import java.net.URLDecoder
import java.net.URLEncoder
import java.util.*
import java.util.Date
import javax.inject.Inject
import javax.inject.Singleton

Expand Down