Skip to content

Commit

Permalink
fix: mozhi engine error 500 when source or target lang has more than …
Browse files Browse the repository at this point in the history
…2 chars (#459)

Co-authored-by: Bnyro <bnyro@tutanota.com>
  • Loading branch information
GitGitro and Bnyro authored Jan 14, 2025
1 parent 540e266 commit 1b6cd20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/bnyro/translate/api/mh/MhEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class MhEngine : TranslationEngine(
override suspend fun translate(query: String, source: String, target: String): Translation {
val response = api.translate(
engine = getSelectedEngine(),
source = sourceOrAuto(source),
source = sourceOrAuto(source.substring(0, 2)),
query = query,
target = target
target = target.substring(0, 2),
)
return Translation(
translatedText = response.translatedText,
Expand Down

0 comments on commit 1b6cd20

Please sign in to comment.