googlesamples / googlesamples/mlkit

[Bug report] [Translate] Translation returns original input unchanged for specific sentences (e.g. EN → JA)

Open
#1,051 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
4.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When using ML Kit's on-device Translation API to translate specific English sentences into Japanese (or potentially other target languages), the API silently returns the original source string instead of a translated result. No error is thrown, and the OnSuccessListener fires normally — making it appear as though translation succeeded.

**Affected Input Example:**
```
Today, we received final client approval for the layout.
```
Translating this string from English (EN) to Japanese (JA) returns the exact input string unchanged.

**Additional Notes**

- No exception or failure callback is triggered — OnSuccessListener fires as if translation succeeded.
- The issue appears to be input-specific; other sentences translate correctly.
- Replacing/Removing trigger words (e.g. "client", "approval") produces correct translations.

**To Reproduce**
You can reproduce this using the [MLKit Quickstart Sample App](https://github.com/googlesamples/mlkit/tree/master/android/translate):

Clone the repo and open the android/translate sample in Android Studio.
Ensure the EN → JA translation model is downloaded on-device.
Input the following text into the translation field:

```
Today, we received final client approval for the layout.
```

Set source language to English and target language to Japanese.
Tap Translate.

**Expected behavior**

Expected Result:
A Japanese translation, e.g.:

```
本日、レイアウトについてクライアントから最終承認をいただきました。
```

Actual Result:
The original English string is returned unchanged:

```
Today, we received final client approval for the layout.
```

**SDK Info:**

- MlKit Translate [com.google.mlkit:translate:17.0.3]

**Smartphone:**
- Samsung S25 (can be reproduced on other models as well)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.