Do not offer SelectTranslations Translate Link Text menu item for URLs
Categories
(Firefox :: Translations, enhancement, P3)
Tracking
()
People
(Reporter: nordzilla, Assigned: nordzilla)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Description
There are many cases in which the "Translate Link Text" option for the Select Translations Panel will be for a URL, rather than plain text that is hyperlinked.
If the linked text is verified to be just a URL, we should not offer to translate, because any translation on the URL would most likely yield an invalid URL.
If the user manually selects a URL, however, and choose to translate their active selection, rather than right clicking linked text, then we will still translate their selection regardless.
Steps to implement
- Modify the logic of the [https://searchfox.org/mozilla-central/rev/10e7fbf7a5a46e10b83becff0f16ffdedc9abe3d/browser/base/content/nsContextMenu.js#2610) function to not show the menu item if we are attempting to translate link text that is just a URL.
Tests to implement
- Write a test that ensures that the menu item is not available when right clicking link text that is a just a URL.
Assignee | ||
Comment 1•5 months ago
|
||
This patch ensures that the Translate Link Text
option is not offered in the context menu when
right clicking hyperlinked text that would result
in translating a only a URL being translated.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 4•5 months ago
|
||
Backed out for causing bc failures in browser_contextmenu.js
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | browser/base/content/test/contextMenu/browser_contextmenu.js | checking item #14 (context-translate-selection) name - Got "---", expected "context-translate-selection"
Assignee | ||
Comment 5•5 months ago
•
|
||
UPDATE
I ran the Translations test suite in try, but I forgot to check the general context-menu tests, which caused a failure.
I've now updated the relevant general context-menu tests.
Comment 7•5 months ago
|
||
bugherder |
Assignee | ||
Comment 8•5 months ago
|
||
This patch ensures that the Translate Link Text
option is not offered in the context menu when
right clicking hyperlinked text that would result
in only a URL being translated.
Original Revision: https://phabricator.services.mozilla.com/D212980
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Comment 10•5 months ago
|
||
I can reproduce this issue in Nightly v129.0a1 from 2024-06-10; I can confirm the fix in Nightly v129.0a1 from 2024-06-20 and Beta v128.0b5. The plain URL links (hyperlinks without representation text) no longer offer the option to translate in context menu. Closing as verified.
Description
•