Closed Bug 1870305 Opened 9 months ago Closed 9 months ago

Add context-menu item for Select Translations when selection is present

Categories

(Firefox :: Translations, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

References

Details

Attachments

(4 files)

Description

This bug tracks the progress of creating the context-menu item that will open the Select Translations Panel when text is selected.

The menu item will only be available when there is a present text selection, and when we have determined that the translated text is supported by our available languages.


Steps to implement

  • Add a menu item to the context-menu
  • Add localized text for translating to the target language, following the same logic to determine the language as Full-Page Translations
  • Ensure that the menu item is only available when the correct criteria are met (see description).

Tests to implement

  • Test for the non-existence of the menu item when translations is unavailable.
  • Test for the existence of the menu item when translations is available.
  • Test that the localized text and target language are correct.
Blocks: 1870306
Assignee: nobody → enordin

Refactors the way we assert visibility in teh Translations
test suite in order to make it easier to test the Select
Translations context menu item.

Renames the data member textSelected to selectedText.
I think textSelected sounds more like a boolean, rather
than a string, and I think selectedText is a better name.

Depends on D197222

Adds the Select Translations context menu item
to the right-click context menu with an initial
localized label value.

Depends on D197223

Ensures that the Select Translations context menu
item only appears when there is actively selected text
at the time the context menu is invoked.

Depends on D197224

Attachment #9370102 - Attachment description: WIP: Bug 1870305 - Refactor visibility assertions in Translations tests → Bug 1870305 - Refactor visibility assertions in Translations tests r=#translations-reviewers!
Attachment #9370103 - Attachment description: WIP: Bug 1870305 - Rename textSelected to selectedText in nsContextMenu.js → Bug 1870305 - Rename textSelected to selectedText in nsContextMenu.js r=#translations-reviewers!
Attachment #9370104 - Attachment description: WIP: Bug 1870305 - Add Select Translations context menu item → Bug 1870305 - Add Select Translations context menu item r=#translations-reviewers!
Attachment #9370105 - Attachment description: WIP: Bug 1870305 - Show Select Translations context menu item when text is selected → Bug 1870305 - Show Select Translations context menu item when text is selected r=#translations-reviewers!
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45ade6253941 Refactor visibility assertions in Translations tests r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/e817f31d2d1a Rename textSelected to selectedText in nsContextMenu.js r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/989da1a73e73 Add Select Translations context menu item r=translations-reviewers,fluent-reviewers,bolsson,gregtatum https://hg.mozilla.org/integration/autoland/rev/68921f44e88b Show Select Translations context menu item when text is selected r=translations-reviewers,fluent-reviewers,bolsson,gregtatum
Regressions: 1886753
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: