Skip to content

Commit 1b6cd20

Browse files
GitGitroBnyro
andauthored
fix: mozhi engine error 500 when source or target lang has more than 2 chars (you-apps#459)
Co-authored-by: Bnyro <[email protected]>
1 parent 540e266 commit 1b6cd20

File tree

1 file changed

+2
-2
lines changed
  • app/src/main/java/com/bnyro/translate/api/mh

1 file changed

+2
-2
lines changed

app/src/main/java/com/bnyro/translate/api/mh/MhEngine.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ class MhEngine : TranslationEngine(
6161
override suspend fun translate(query: String, source: String, target: String): Translation {
6262
val response = api.translate(
6363
engine = getSelectedEngine(),
64-
source = sourceOrAuto(source),
64+
source = sourceOrAuto(source.substring(0, 2)),
6565
query = query,
66-
target = target
66+
target = target.substring(0, 2),
6767
)
6868
return Translation(
6969
translatedText = response.translatedText,

0 commit comments

Comments
 (0)