Tuesday, November 21, 2023

Firefox's translation feature needs to be suppressed on pages that already have an official target language version

Recent versions of Firefox have a "translate this page" function that pops up if it detects that the webpage is in a language other than the preferred language indicated in your settings.

They need to figure out a way to stop this from automatically popping up when an official version of the page exists in your preferred language.

 
For example, if I, with my default English settings, end up on the French version of the federal government's COVID wastewater monitoring dashboard, a conspicuous "Translate this page" bubble pops up front and centre. 

This is a problem, because an official English version of the page exists. You can access it by clicking the English link on the top right. And the automatically translated version is never going to be as good or as authoritative as the official English version.

screenshot of the Tableau de bord sur la vigie de la COVID-19 dans les eaux usées, with the English link at the top right highlighted
Screenshot of linked page, with the English link at the top right highlighted


 
People outside of translation/language intersection spaces don't always know that pages with multiple language versions exist, but they are common, especially in institutional (government, education, etc.) spaces that provide official information.
 
Firefox's translation feature needs to avoid distracting these uninformed users from the existence of the official multilingual versions that they may not even know to look for.

So how do you do that from a programming perspective?

Preliminary idea to build on: what if the translation feature could detect the name of the target language in the target language? If the user has English set as their default language, it detects the word "English" on the page. Perhaps it could highlight it? Perhaps the translation feature could say "An official version may exist"?

This wouldn't catch every instance. Some websites use abbreviations (en, fr, de, es, pl) and some websites use flags. However, there may be a finite number of ways that these are coded, or commonalities to the scripts used to switch the language, or indicators in the metadata.

Another possibility would be to have the pop-up appear elsewhere on the page (maybe towards the bottom left of the visible portion?) so it's less likely to cover the link to the official version. 

In any case, however well-intentioned this automatic translation feature is, it needs to avoid making it difficult to find the official version of the page in the target language.

2 comments:

Lorraine said...

I haven't figured out what the criteria are for Firefox' translation popup to appear. For me it most often appears on Friendica (part of the Fediverse) if either the first or second "toot" is in some non-English language, which seems to imply that the lang attribute of the html element is not the decisive criterion. Nor is it a question of what language accounts for "most" of a page. Note that some 90% of my Friendica feed at any given time is probably in English.

It is also the case that I often go to a thoroughly foreign language website (typically a foreign newspaper) and I could really use a full page translation, and not only does Firefox' translation not come out of the woodwork, I have no idea where in the woodwork to find it. So I use the To Google Translate add-on, which offers right-mouse-menus for translating a selection or the current page, and basically works. I'm very excited that there now exists an open source translation engine, but as is too often the case, Mozilla seems to be trying to supply much proof that commercial solutions are always more user friendly than open source ones.

As for links to official translations, it seems the English link in your G de C page is written

<a lang="en" href="https://health-infobase.canada.ca/covid-19/wastewater/">English</a>

I had never heard of the "a" element having a "lang" attribute, but it makes all kinds of sense, so I checked to see if it's part of the standard. It seems it is not, but it turns out there is officially an "hreflang" attribute for the "a" element. As far as I can tell, this indicates what language is on the other end of the link, but not that it's considered a translation of the present page.

impudent strumpet said...

I hadn't considered the question of when it isn't popping up. I've long since disabled it because it kept popping up when it was actively unwanted.

The vast majority of my non-English internet use is translation-related research, where I'm actively seeking an English equivalent of something that I googled up in the source language (e.g. What is the official English name of this official policy? What is this hardware component called in English?) and therefore actively seeking an official English equivalent of the page.

Which makes me realize that most of the times I was seeing it were likely on pages that did have an official English equivalent, and makes me wonder if it's somehow inadvertently working in the exact opposite of the way it needs to, and, for whatever reason, popping up more frequently on pages that do have an official English equivalent?