- 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?');
- 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.
by sandstrom
1 subcomments
- This would be very useful.
Basically, the 'translate this' button you see on Twitter or Instagram next to comments in foreign languages. This API would make it trivial for all developers to add that to their web apps.
- As maintainer of https://linguister.io/, should I start work on polyfill for that API?
If this API will be implemented in next few years, there will be browsers who hold up the world in progress.
Linguist have enough many users, so we could expose this API for client side code, and users with browsers where Translation API is not implemented yet, could install Linguist and sites who uses Translation API would works fine. Translation API calls would proxy by Linguist and preferred translator module would be used.
Any thoughts about it?
by RockRobotRock
1 subcomments
- https://github.com/mozilla/standards-positions/issues/1015
by pwdisswordfishz
2 subcomments
- Why does it need to be a JavaScript API?
Why not just use the lang= attribute as it was intended, then let the user select text to translate as they wish?
- You had me at "Browser compatibility".
- With js being a garbage collected language, what is the benefit of the destroy method here and why is it necessary?
- 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.
- Wish this was a desktop API too, would be useful outside web browsers too, especially in email clients.
- I was excited that Firefox finally exposed its local translations as API, but it's Chrome-only (still?). Will be nice for userscripts, for example to replace Twitter's translation button that hardly ever works
by mediumsmart
0 subcomment
- I am ok with Chronic translating the Italian version of a site back into the original German version living in the neighboring folder for good money.
- So, the browsers have to provide some means for choosing the desired translation engine (add-on API maybe?) and this is a standard API which all of the providers should implement.
right?
- This gives strong IE vibes.
- 灌灌灌灌
- 哈哈哈
by lofaszvanitt
0 subcomment
- Another useful feature that nobody could've replicated themselves.
by curtisszmania
0 subcomment
- [dead]