Live data from Hacker News

Web Translator API

developer.mozilla.org

11–20 of 71 posts

Re: Web Translator API

#12
post #5

Earlier quoted context omitted.

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.

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.

ollama run gemma3:1b

https://ollama.com/library/gemma3

> support for over 140 languages

Re: Web Translator API

#13
post #5

Earlier quoted context omitted.

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.

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.

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.

Re: Web Translator API

#14
post #3

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.

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.

Re: Web Translator API

#15
post #5

Earlier quoted context omitted.

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.

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.

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

Re: Web Translator API

#16
post #5

Earlier quoted context omitted.

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.

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.

https://ai.meta.com/blog/nllb-200-high-quality-machine-trans... https://www.youtube.com/watch?v=AGgzRE3TlvU

Re: Web Translator API

#17
post #12

Earlier quoted context omitted.

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.

ollama run gemma3:1b https://ollama.com/library/gemma3 > support for over 140 languages

Try to translate a paragraph with 1b gemma and compare it to DeepL :) Still amazing it can understand anything at all at that scale, but can't really rely on it for much tbh

Re: Web Translator API

#18
post #8

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.

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.

Re: Web Translator API

#19

Earlier quoted context omitted.

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.

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…

Tip: You might want to use `uv tool install llm --with llm-ollama`.

ref: https://github.com/simonw/llm/issues/575

Re: Web Translator API

#20
post #8

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.

This is not auto-translation.

Rather, it's an API developers can use to add inline translation to web apps.

For example, under a comment in your app, you can (a) detect the language, and (b) if it's different from the current users/browsers language, offer to translate it with a small link (c) if the user clicks the link, the content is translated to their language.

Post reply on HN