Web App is mistakenly translated
Categories
(Firefox :: Translations, defect)
Tracking
()
People
(Reporter: spagel, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Steps to reproduce:
In my org, rather everyone is using a certain web app (ExLibris Alma, a library management system). Since we upgraded to Firefox 128.3.1 ESR (from 115.15.0 ESR) this web app is sometimes mistakenly translated from English into German, even though it is already in German.
Actual results:
As the translation occurrs, even though the web app is already in German, it fails. This causes severe rendering bugs in the app making it unusuable unless you disable translation. Since some of our users have English set to "Always translate", this causes quite some issues in our users' daily workflow, unless we manually set the web app's URL to "Never translate".
This seems to occur because as the web app loads, the <html lang=""> attribute is first not there, then switches to lang="en" and when the page is fully loaded switches again to lang="de".
Expected results:
If the translation fails, the non-translated original web page should show, not a broken half-translated version.
Comment 1•5 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Translations' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•5 days ago
|
||
Hmm... this is tricky. Technically this is an issue with the site implementation, as it's reporting the wrong language. However, on the web "en"
is the frequent default for a lang
property, so it makes sense to have mitigations against it.
If the translation fails
There's no way really to detect if the translation fails, as the language models are essentially black boxes.
It's curious to think about what happens if the page switches out the language tags. We could listen for the lang
property to change, and the cancel the translation request. It's possible to cancel it before the first translation comes back if the lang
property changes. This would still potentially leave the page in a broken state.
The other option would be to perform language identification before running the automatic translate, and skip auto-translate in this case. However, automatic translation is also fallible.
:nordzilla any additional thoughts here?
Comment 3•5 days ago
•
|
||
This is tricky.
I think we have two bugs on file that are relevant here:
Bug 1859081 - Run language detection before offering a translation
From Greg Tatum in comment 2
The other option would be to perform language identification before running the automatic translate, and skip auto-translate in this case. However, automatic translation is also fallible.
Based on the algorithm that we agreed on, I think we would actually avoid the issue in this bug:
- If the
langTag
is received when its value is""
then the language detection would detect German, and if that is a spoken language for the user then no action will be taken. - If the
langTag
is received when its value is"en"
then the language detection would detect German and disagree with the markup tag, resulting in no action being taken. - If the
langTag
is received when its value is"de"
then the language detection would agree on German, and if that is a spoken language for the user then no action will be taken.
Bug 1831768 - Consider reverting the translation without reloading the page
From Greg Tatum in comment 2
It's curious to think about what happens if the page switches out the language tags. We could listen for the lang property to change, and the cancel the translation request. It's possible to cancel it before the first translation comes back if the lang property changes. This would still potentially leave the page in a broken state.
I think we could potentially add a listener here, but I think that taking action on the change would be blocked by Bug 1831768. With the current page-reloading behavior we could potentially get users stuck in an endless cycle of reloading if we were to react to a language tag change by changing the translation languages.
Description
•