Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Translation API #147

Closed
domenic opened this issue Apr 24, 2024 · 6 comments
Closed

Web Translation API #147

domenic opened this issue Apr 24, 2024 · 6 comments
Labels
Category: JS Category for JS language proposals. Category: Media & RTC For Media (video/audio) and Real-Time Communications proposals. Category: Uncategorized Proposals that defy categorization, or don't fit into any other existing category. Category: Web Apps Proposals that aim to bring more App-like behaviors and functionality to the web. repo_adopted

Comments

@domenic
Copy link

domenic commented Apr 24, 2024

Introduction

Browsers are increasingly offering language translation to their users. Such translation capabilities can also be useful to web developers. This is especially the case when browser's built-in translation abilities cannot help, such as:

  • translating user input or other interactive features;
  • pages with complicated DOMs which trip up browser translation;
  • providing in-page UI to start the translation; or
  • translating content that is not in the DOM, e.g. spoken content.

To perform translation in such cases, web sites currently have to either call out to cloud APIs, or bring their own translation models and run them using technologies like WebAssembly and WebGPU. This proposal introduces a new JavaScript API for exposing a browser's existing language translation abilities to web pages, so that if present, they can serve as a simpler and less resource-intensive alternative.

Read the complete Explainer.

Feedback

Please provide all feedback below.

I welcome feedback in this thread, but encourage you to file bugs against the Explainer.

@ahmadalfy
Copy link

As someone who usually build multi-lingual applications and websites (mostly in Arabic and English), I think this is going to be very helpful. I can think of

  • Real-time user input translation. We can offer real-time translation of user-generated content such as comments, chat messages, or forum posts.
  • Translate interactive elements, such as tooltips, error messages, or form labels.
  • Translation of user generate content. This is usually a huge pain. Let's say we have a marketplace that can be used in multiple language. We don't ask the user to add their items in all languages available.
  • Simplify localization testing
  • Cost efficiency, by reducing the dependency on external services

@parkjoon
Copy link

I work in e-commerce and can't do justice to portray how impactful this would be. Walmart had to create a whole new website (and organization) to support Spanish. Target still struggles to support Spanish queries. A very large part of (double digits) the e-commerce customer base is a native Spanish speaker (in America). Now extrapolate to other languages/ESL - that's a hell of a lot of people that can't use the services in the same way native English speakers can. The way I see it, enabling standardized translation APIs is no different than enabling alt tags on images. The Web is for everyone.

@cwilso
Copy link
Member

cwilso commented Apr 29, 2024

@domenic This seems to have plenty of support, if you're good with it I can move it over into WICG. (I have admin, just wanted to check with you before moving.)

@krzksz
Copy link

krzksz commented Apr 30, 2024

We work with merchants at Shopify to improve their online store speed. They would often be using some 3rd party translation solutions like: Langify, Weglot, Transcy, and many others.

When it comes to web performance, the main issue is that those services usually include a bunch of client-side JavaScript that detects (through MutationObserver) and translates all of the content. This logic is so expensive, it can be a major blocker from achieving a good Interaction To Next Paint.

I'm not sure if this API aims to cover this. Still, I imagine it would be super impactful to provide a more performant way to translate content on the fly. It can get quite complicated though as just listening for the text nodes is not enough. The API would also have to work with attributes (different links, images, backgrounds, etc.). At least that's what those 3rd tools are able to do currently.

@domenic
Copy link
Author

domenic commented Apr 30, 2024

@cwilso thank you, yes, let's move it!

@cwilso cwilso added Category: Uncategorized Proposals that defy categorization, or don't fit into any other existing category. Category: JS Category for JS language proposals. Category: Media & RTC For Media (video/audio) and Real-Time Communications proposals. Category: Web Apps Proposals that aim to bring more App-like behaviors and functionality to the web. repo_adopted labels May 1, 2024
@cwilso
Copy link
Member

cwilso commented May 1, 2024

Done, and you (@domenic) have admin there: https://github.com/WICG/translation-api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: JS Category for JS language proposals. Category: Media & RTC For Media (video/audio) and Real-Time Communications proposals. Category: Uncategorized Proposals that defy categorization, or don't fit into any other existing category. Category: Web Apps Proposals that aim to bring more App-like behaviors and functionality to the web. repo_adopted
Projects
None yet
Development

No branches or pull requests

5 participants