Closed Bug 1904355 Opened 5 months ago Closed 4 months ago

Allow SelectTranslationsPanel while Full Page Translations is Active

Categories

(Firefox :: Translations, enhancement)

Desktop
All
enhancement

Tracking

()

VERIFIED FIXED
130 Branch
Tracking Status
relnote-firefox --- 130+
firefox130 --- verified
firefox131 --- verified

People

(Reporter: nordzilla, Assigned: nordzilla)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Description

Currently, we disallow the Select Translations Panel from being offered while Full Page Translations is active. Some of these reasons are described in comment 2 of Bug 1901455.

Ultimately, we should allow this to happen, but we will just hide the translate-full-page button from the panel when Full Page Translations is active, to prevent confusing scenarios involving re-translation.

We should probably also add a telemetry event extra key to the panel open event, logging whether full-page translations was active when the panel opened, or not.


Steps to implement

  • Remove the restriction disallowing Select Translations on top of Full Page Translations.
  • Hide the translate-full-page button from the Select Translations Panel when Full Page Translations is active in the current tab and window.
  • Add a telemetry extra key for the open event that covers this distinction.

Tests to implement

  • Update all tests and visibility assertions to the new expectations.
  • Update telemetry tests to check for this extra key.
  • Add a new test case specifically for select translations on top of full page translations.
See Also: → 1901455

The severity field is not set for this bug.
:gregtatum, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gtatum)
Type: defect → enhancement
Flags: needinfo?(gtatum)
Attachment #9411895 - Attachment description: WIP: Bug 1904355 - WIP → WIP: Bug 1904355 - Show select-translations context menuitem when FPT is active r=#translations-reviewers!

Now that Select Translations is available while Full-Page-Translations (FPT)
is active, this patch ensures that the translate-full-page button in the
Select Translations Panel is hidden and disabled when FPT is currently active,
to avoid complicated UX around what it would mean to re-trigger a FPT request.

Depends on D216106

The Full-Page Translations (FPT) actor listens for translation errors
tied to the innerWindowID when it is active. This way it can show the
FPT panel error state if an error occurs. This patch ensures that the
Select Translations Panel (STP) is decoupled from the innerWindowID,
so that if the STP encounters a translation error while FPT is active
without error, that FPT will not react to the unrelated error state.

Depends on D216424

Attachment #9411895 - Attachment description: WIP: Bug 1904355 - Show select-translations context menuitem when FPT is active r=#translations-reviewers! → Bug 1904355 - Show select-translations context menuitem when FPT is active r=#translations-reviewers!
Attachment #9412525 - Attachment description: WIP: Bug 1904355 - Hide translate-full-page button when full-page translations is active r=#translations-reviewers! → Bug 1904355 - Hide translate-full-page button when full-page translations is active r=#translations-reviewers!
Attachment #9412526 - Attachment description: WIP: Bug 1904355 - Ensure Select Translations errors are decouple from Full Page r=#translations-reviewers! → Bug 1904355 - Ensure Select Translations errors are decouple from Full Page r=#translations-reviewers!
Attachment #9412526 - Attachment description: Bug 1904355 - Ensure Select Translations errors are decouple from Full Page r=#translations-reviewers! → Bug 1904355 - Ensure Select Translations errors are decoupled from Full Page r=#translations-reviewers!
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d0dd24adb6e Show select-translations context menuitem when FPT is active r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/27b4bc555026 Hide translate-full-page button when full-page translations is active r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/aef5e88112ec Ensure Select Translations errors are decoupled from Full Page r=translations-reviewers,gregtatum
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

Release Note Request (optional, but appreciated)

[Why is this notable]:
The Select Translations Panel (STP) can now be accessed on a page that is actively being translated by the Full-Page Translations (FPT) feature.

For example, if I translate a French page into German using FPT, I can then highlight a selection of the now-German text and use STP to translate that text from German into another language, or back into French to see how well the translation round-trips.

This also affects situations on sites such as https://www.leparisien.fr/, which shows a popup that is marked with notranslate. The FPT feature respects the notranslate in the markup and does not translate the popup. Previously, since STP was inaccessible while FPT is active, a user would be stuck with a notranslate popup that they cannot read if they don't speak French. Now, they can select the text from the popup and use STP to translate the popup text to their desired language even while FPT is actively translating the rest of the page.

[Affects Firefox for Android]:
No

[Suggested wording]:

[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?

Note added to nightly with this wording:

Firefox now allows translating selected text portions to different languages after a full-page translation.

I am keeping the release-note flag request open to keep it on our radar for our beta and final release notes. Thanks.

Flags: qe-verify+
QA Contact: dbodea

I can confirm that the Select Translation feature can be used on pages that were translated using the Full Page Translation feature in Beta v130.0b4 and Nightly v131.0a1 in Windows 10, Mac 11 and Ubuntu 22.

Steps used to test:

  1. Load a webpage that is in a different language than the browsers and supported:
    https://de.wikipedia.org/wiki/Wikipedia:Hauptseite
  2. Use the Full Page Translation feature to translate the page to another supported language, other than the browser's (like Spanish)
  3. Select a string of text from the page, open the context menu and select the Translate option.
    After the implementation: The Select Translation feature is usable on pages that were translated by the Full Page Translation feature.
    Before the implementation: The Select Translation option is not available in the context menu on a page that was translated by the Full Page Translation feature.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
OS: Unspecified → All
Hardware: Unspecified → Desktop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: