Description
Currently, if a website is in one language, but wants to link to a site for important information that is only available in some other language, they have a few options:
- Link directly to the site in question, and hope the user is able to translate (either based on their knowledge of the language, or with the help of tools, or with the help of their browser, as is the case in Chrome and Edge).
- Link to a machine-translated version of the site (example)
Both of these are not great. In general, the translation produced by (2) is poor, because it acts on the server-rendered page before any JavaScript gets a chance to execute. This can break the JavaScript and UI, in fact. For (1), the issue is that the site may have more information about the preferred language than the browser does; Chrome has data that many users leave their device set to English, despite that not being their preferred language.
Currently we have teams within Google that are working around this using a Chrome- and Android-proprietary solution, by changing their links to specific Android intents (e.g. chrome-translate://to-hindi/https://en.wikipedia.org/wiki/Cat
). Chrome can then interpret this intent and trigger the translate UI appropriate. But we thought it was a good idea to work on something that could benefit all browsers and clients, not just Chrome on Android.
As such, we'd like to propose a way of hinting to the client that it should translate an outgoing link into a specific language, which pages can use to reliably suggest the desired translation. In Chrome, we are interested in using this to trigger our built-in translation, but you could also imagine its uses for other clients (including e.g. browser extensions). A simple strawperson is <a href="..." translatehint="hi">
(using a standard language code). This version would then be feature-testable via "translateHint" in HTMLAnchorElement.prototype
.
How does this sound? Chrome is certainly interested in implementing. We're hoping to get a sense whether others think adding a standardized way to do this is a good idea, or whether we should keep exploring proprietary solutions.