The on-device translation is not available at page A while working at page B.

36 views
Skip to first unread message

Victor Zhang

unread,
Dec 24, 2025, 4:08:39 AM (yesterday) Dec 24
to Chrome Built-in AI Early Preview Program Discussions
Hi, I'm building a Chrome Extension with Chrome Translator API, I added warmup polling and retry method to check `availability()` and increase the chance of successful `create()` translator, but it will still failed at some page. while working at other page on the same Chrome profile browser.

Sometime it will recovered after I relaunch the Chrome browser, but now it wouldn't work now.

How can I fix this issue? thanks!

Screenshot 2025-12-24 170004.png

Victor Zhang

unread,
Dec 24, 2025, 4:35:26 AM (yesterday) Dec 24
to Chrome Built-in AI Early Preview Program Discussions, Victor Zhang
is there any maximum translator limitation for each Shadow DOM or the whole browser?

François Beaufort

unread,
Dec 24, 2025, 4:46:50 AM (yesterday) Dec 24
to Victor Zhang, Chrome Built-in AI Early Preview Program Discussions
Which pair of languages did you use?
Could you share the code by any chance?

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/b46853d8-10ca-4678-bdac-0c3d320742b2n%40chromium.org.

Victor Zhang

unread,
Dec 24, 2025, 5:44:42 AM (yesterday) Dec 24
to Chrome Built-in AI Early Preview Program Discussions, François Beaufort, Chrome Built-in AI Early Preview Program Discussions, Victor Zhang
Hi François,

Thanks for your reply, my main language pair is en->zh-Hans, I'm product manager, and has no technical background, just vibe coding with the best thought I can.

last week, I encountered two type of error messages on the console logs, "udp multicast:1 The translation service count exceeded the limitation." and "The on-device translation is not available.", I come up with a idea that designing a backend coordinator to control the maximum number of the concurrent translator, set the max number to 3. this approach works well for a week, but this week I still encountered the same error.

While I post here for help, I have code agent to fix for me, I tested and it has fix the issue. here are the design changes:

Problem: On iframe-heavy sites (X.com has 10+), concurrent Translator.create() calls hit "The on-device translation is not available" or "service count exceeded" despite having coordination logic.

 

Root Cause: The background registry tracked translators after creation succeeded. By the time it detected the limit and evicted, Chrome had already rejected the new create() call.

 

Solution: Gate creation before calling Translator.create(), not after.

 

Protocol:

  1. RESERVE → Background checks limit, evicts if needed, waits for DESTROY_ACK
  2. CREATE → Content script calls Translator.create() (slot guaranteed)
  3. CONFIRM/RELEASE → Report success or failure

Key difference: Eviction is now synchronous. the content.js wait for the old translator to be destroyed (confirmed via ACK) before approving a new creation. This ensures Chrome's internal count decrements first.

 

Config: Max 3 concurrent translators, 5s ACK timeout, LRU eviction preferring idle instances.

 


Here are my questions:

  1. Recommended max concurrent Translator instances per extension?
  2. Does translator.destroy() release the slot synchronously?
  3. Any API to query remaining capacity?
Best regards,
Victor Zhang

François Beaufort

unread,
Dec 24, 2025, 6:06:32 AM (yesterday) Dec 24
to Victor Zhang, Chrome Built-in AI Early Preview Program Discussions
The following code which creates 100 Translator instances does not throw for me.

const options = { sourceLanguage: "en", targetLanguage: "zh-Hans" };
const promises = [];
for (let i = 0; i < 10; i++) promises.push(Translator.create(options));
await Promise.all(promises);

This other code which creates 100 Translator instance per iframe does not throw for me either.

const options = { sourceLanguage: "en", targetLanguage: "zh-Hans" };
const promises = [];
for (let i = 0; i < 10; i++) {
  const iframe = document.createElement("iframe");
  document.body.appendChild(iframe);
  promises.push(iframe.contentWindow.Translator.create(options));
}
await Promise.all(promises);

Having said that, https://source.chromium.org/chromium/chromium/src/+/main:components/on_device_translation/features.h;l=33;drc=8c7bd73f24f4936795272eece99089a6d75651cf suggests there's a limit of 10 translator instances per browsing context (profile). Could that be it?

Victor Zhang

unread,
Dec 24, 2025, 8:34:01 AM (23 hours ago) Dec 24
to Chrome Built-in AI Early Preview Program Discussions, François Beaufort, Chrome Built-in AI Early Preview Program Discussions, Victor Zhang
hi ,

thank you for your support, I changed the max limit to 8, changed the flag(chrome://flags/#translation-api) from "default" to "Enabled without language pack limit" and relaunch, it works, it seems the translator is not stable at the default flag, even thought I have downloaded the en->zh language pair.

Best regards,
Victor Zhang
Reply all
Reply to author
Forward
0 new messages