Web Translator API
18 comments
·June 25, 2025lynx97
Can we please NOT autotranslate the web? I have yet to find a site where the quality of autotranslate does not make me stop using that site. I was already irritated when google started to show me de.wikipedia.org articles adespite me explicitly searching for the english article name. Then came Etsy, where the autotranslate quality was so bad I stopped using the site altogether.
diggan
The good news is that if the browsers offered this natively, websites wouldn't need their own implementation of this. And if it's in the client (the browser), you're most likely gonna be able to turn it off globally, just like how you like it.
Worst case scenario a user-script/extension could monkey patch it out, but probably clients will let you disable it.
rhabarba
You had me at "Browser compatibility".
Raed667
Chrome embeds a small LLM (never stops being a funny thing) in the browser allowing them to do local translations.
I assume every browser will do the same as on-device models start becoming more useful.
Asraelite
What's the easiest way to get this functionality outside of the browser, e.g. as a CLI tool?
Last time I looked I wasn't able to find any easy to run models that supported more than a handful of languages.
JimDabell
That depends on what counts as “a handful of languages” for you.
You can use llm for this fairly easily:
uv tool install llm
# Set up your model however you like. For instance:
llm install llm-ollama
ollama pull mistral-small3.2
llm --model mistral-small3.2 --system "Translate to English, no other output" --save english
alias english="llm --template english"
english "Bonjour"
english "Hola"
english "Γειά σου"
english "你好"
cat some_file.txt | english
https://llm.datasette.io_1
If you need to support several languages, you're going to have to have a zoo of models. Small ones just can't handle that many; and they especially aren't good enough for distribution, we only use them for understanding.
rhabarba
While I appreciate the on-device approach for a couple of reasons, it is rather ironic that Mozilla needs to document that for them.
its-summertime
Firefox also has on-device translations for what its worth.
troupo
While this might be useful, be mindful:
- it's experimental
- the "specification" is nowhere near a standards track: https://webmachinelearning.github.io/translation-api/
Of course it's already shipped in Chrome, and now Chrome pretends that its own Chrome-only API is somehow standard. Expect people on HN to blame other browsers for not shipping this.
jazzypants
I've been pleasantly surprised by the last few conversations about this type of thing that I've seen. It seems like people are pretty sick of Chrome's IE proclivities.
nachomg
This gives strong IE vibes.
https://developer.chrome.com/docs/ai/translator-api
const translator = await Translator.create({ sourceLanguage: 'en', targetLanguage: 'fr', });
await translator.translate('Where is the next bus stop, please?');