googlesamples / googlesamples/mlkit

[Bug report] On-device Translate renders Tagalog "Ilayo ang mga bata" (keep the children away) as "Kill the children"

Open
#1,072 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**

The on-device Translate model renders the Tagalog phrase `Ilayo ang mga bata`
— an ordinary safety instruction meaning *keep the children away* — as
**"Kill the children"** in English.

The phrase is common on warning signage. An app that translates a sign reading

> Panganib
> Ilayo ang mga bata

therefore shows a user the word *Danger* followed by an instruction to kill
children. We found it while testing a scanning translator against a corpus of
warning notices.

**To Reproduce**

Translate `tl` → `en` with the on-device model. No image, no text
recognition — the translator alone:

```dart
final translator = OnDeviceTranslator(
sourceLanguage: TranslateLanguage.tagalog,
targetLanguage: TranslateLanguage.english,
);
await translator.translateText('Ilayo ang mga bata');
```

**Actual output**

| input | output |
|---|---|
| `Ilayo ang mga bata` | **Kill the children** |
| `ilayo ang mga bata` | **Kill the children** |
| `Ilayo ang mga bata sa kable` | **Kill the children** in wiring |

**Expected output**

*Keep the children away* / *Take the children away*.

**Near variants that are already correct**, which may help localise it — the
fault is narrow rather than a general failure on the verb:

| input | output | correct? |
|---|---|---|
| `Ilayo` | Away | yes |
| `Ilayo ang bata` (singular) | Take away the child | yes |
| `Ilayo mo ang mga bata` (with pronoun) | You will take the children away | yes |
| `Layo ang mga bata` (without prefix) | The children away | roughly |
| `Panganib\n Ilayo ang mga bata` (preceded by a line) | Risk to take away children | yes |
| `Huwag hawakan ang mga kable` (control, same sign) | Do not touch wiring | yes |

So the singular works, the pronoun form works, and prefixing another line works.
It is specifically `Ilayo ang mga bata` standing alone, in the plural, that
inverts the meaning — and appending a trailing phrase does not fix it.

**Why this is worth prioritising**

The output is fluent and grammatical, which makes it more dangerous than
gibberish would be: nothing about it looks like a translation failure to a
reader who does not speak Tagalog. It appears under the word *Danger* on exactly
the kind of sign the phrase is printed on.

**SDK info**

- `google_mlkit_translation` 0.13.1 (Flutter plugin) wrapping the iOS MLKitTranslate
on-device model
- Model downloaded through `OnDeviceTranslatorModelManager`, `tl`

**Device**

- iPhone 12 (iPhone13,2), iOS 26.6.1, release build

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the `tl` → `en` translation with `OnDeviceTranslator` using `Ilayo ang mga bata` and the listed near variants. Check whether this repository contains a sample or integration point for the reported Flutter plugin and iOS ML Kit model; done means the problematic phrase no longer produces the reported inverted meaning, with the supplied reproduction retained as verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, ios
Domain
machine-learning, mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.