Open Bug 1831768 Opened 2 years ago Updated 3 months ago

Consider reverting the translation without reloading the page

Categories

(Firefox :: Translations, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: soeren.hentzschel, Unassigned)

References

Details

I know that already the Firefox Translations add-on does this, and now the native integration does the same. But it would be a great improvement if the button to revert the translation would not reload the page.

See also the add-on TranslateLocally. It's able to revert the translation without reloading the page.

This would involve caching the original DOM nodes in the TranslationsDocument, probably through some kind of WeakMap, and wiring the TranslationsChild to have a restoreOriginallanguage method, that triggers this restoration on the TranslationsDocument.

We've had some discussion around it, and for the MVP, we'll be shipping it with a simple reload, but it's possible to follow-up with a an actual restore, especially depending on user feedback. We all agreed that reloading the page is at least a simpler implementation. There is a risk on restoring by mutating the DOM that the elements on a dynamic page get restored incorrectly, and cause bad behavior.

So for now, the simpler, safer option is what we'll start with, but this bug is worth keeping for the possibility of implementing, since it could be frustrating for a user to lose their information on a page reload.

I'm marking as P4, as it's not ready to be worked on, since it would require some kind of risk analysis, and justification.

Priority: -- → P4
Priority: P4 → P5
No longer blocks: fx-translation
Summary: Revert the translation without reloading the page → Consider reverting the translation without reloading the page

This feature is critical and the primary reason I cannot use Firefox Translation exclusively. I must continue to use a third-party translation extension because it is safer. Safari 18 and Chrome 131 do not reload the page to restore the original text.

Reloading a page can have harmful consequences, such as resubmitting form data or losing data entered on forms.

When filling out government forms, I often need to switch between the original text and the translated text. Some words have adequate general translations, but I need to check the specific original word to be certain. For example, there are several Svenska words for "incorporation" but the I need to know the specific type of incorporation when filling in a government document.

Duplicate of this bug: 1947056
Duplicate of this bug: 1957101

Moving this to P3, so it's in our backlog. I set it lower during initial feature development as out of scope, but seems worth considering to take on. It adds to the complexity of the TranslationsDocument, and we'd need to consider how exactly to handle the mutations that happen on a page, which seems like a tricky problem. I think would be easier if the alignments step were in Gecko as well, because you could retain the original string, and re-run our normal algorithm in reverse using the alignments information. It would also simplify things if we didn't split DOM nodes .

Priority: P5 → P3
You need to log in before you can comment on or make changes to this bug.