Closed Bug 1838422 Opened 2 years ago Closed 4 months ago

Target language is reset if user clicks outside the translations panel

Categories

(Firefox :: Translations, defect, P3)

Firefox 115
All
Unspecified
defect

Tracking

()

VERIFIED FIXED
133 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox115 --- wontfix
firefox116 --- wontfix
firefox131 --- wontfix
firefox132 --- wontfix
firefox133 --- verified

People

(Reporter: acornestean, Assigned: haoran.tang.personal, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(2 files, 2 obsolete files)

Attached video 2023-06-14_15h49_25.mp4

Affected versions:

  • Nightly 116.0a1/20230613152538
  • Beta 115.0b5/20230613195413

Description:
If the user manually selects a target language in the translations panel and clicks outside the panel (or clicks the Cancel button), which causes the panel to close, the previously selected target language will be reset to the default language.

The issue occurs from the translations panel opened via the main menu “Translate page…” option as well.

Steps to reproduce:

  1. Access https://es.wikipedia.org/wiki/Wikipedia:Portada
  2. Open the Translations panel by clicking the Translations icon in the URL bar
  3. Select a different target language other than the default one
  4. Click outside the panel to close it
  5. Reopen the panel
  6. Notice the previously selected target language has been reset to the default language

Actual:
Selecting a target different language in the Translations panel and then closing the panel results in the target language being reset to default.

Expected:
The user selected target language should persist when closing and reopening the Translations panel.

This would be a nice piece of polish work to do.

Severity: -- → S3
Priority: -- → P3
Severity: S3 → S4

This would be a great first bug.

A contributor would need to find the code associated with the target language in the Translations Panel here:
https://searchfox.org/mozilla-central/source/browser/components/translations/content/translationsPanel.js

They would then need to add a way to determine if the selected to-language has been manually changed and prevent that from being overwritten by the defaults again if so.

A contributor would also need to add tests for this behavior here:
https://searchfox.org/mozilla-central/source/browser/components/translations/tests/browser

e.g.

  1. Load a page
  2. Open the panel
  3. Check that the target language is the expected language
  4. Change the target language
  5. Close the panel
  6. Open the panel
  7. Check that the target language is still changed
  8. Close the panel
  9. Navigate to a different page on a different domain
  10. Open the panel
  11. Check that the target language is still changed
Mentor: enordin, gtatum
Keywords: good-first-bug

i am on this, expect a patch soon

Assignee: nobody → manoahluka
Status: NEW → ASSIGNED

Hi manoah

It looks like you've got two patches posted here for the same thing.

Could you please consolidate them into one?

Locally, you'll want to merge all of your changes into just a single commit and then only keep re-submitting that same commit to phabricator.

Secondly, you'll want to choose the Phabricator patch that you no longer want and abandon it by scrolling all the way to the bottom and choosing "Add Action" to abandon the revision.

Lastly, it looks like your two revisions are linked as parent/child revisions. You will need to unlink them at the top of the page on the right side by clicking Edit Related Revisions and removing the other from being a parent/child revision.

Flags: needinfo?(manoahluka)

this has stalled for some time. can I start working on it?

The pending need-info on this patch has been open for a month at this point, so I would say go ahead and take it if you want to work on it, nzai.

Flags: needinfo?(manoahluka)

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.

Assignee: manoahluka → nobody
Status: ASSIGNED → NEW
Assignee: nobody → haorantang0619
Status: NEW → ASSIGNED

I have fixed the issue where the selected target language in the translations panel was reset when closing and reopening the panel.

Changes made:

  • Ensured that the user-selected target language persists by storing the manually selected language and reapplying it when the panel is reopened.
  • Added a test case to verify that the target language remains consistent after the panel is reopened.

This is my first time contributing to open source. If any additional steps are needed or if further changes are required, I will respond immediately. Thank you!

Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e703aa5051b5 Ensure target language persists when reopening the translations panel. r=nordzilla,translations-reviewers

I checked the fix on the latest Nightly (133.0a1/20240930191214 from https://treeherder.mozilla.org/jobs?repo=autoland&revision=e703aa5051b5e87eed7dd9af0f33b4b9543cc626) under Windows 10 x64 and macOS 11.3.1

The chosen target language now persists when closing and reopening the Translations panel, confirming the fix.

I noticed that the bug still has Assigned as status so I will not change that to Verified until the bug has been set to Resolved (so I don’t interfere with the order of things). However, do note that the bug has been fixed in the Autoland builds linked in Comment 12.

Hi, The issue has been verified Comment 13. However, I do not have the option to set the status to "FIXED" in RESOLVED. Could someone with the necessary permissions update the status accordingly?

Flags: needinfo?(enordin)
Attachment #9358533 - Attachment is obsolete: true
Attachment #9358532 - Attachment is obsolete: true

I've never seen this happen before.

Perhaps it has to do with the two revisions from nearly a year ago that were still under "Needs Review" status.

I've abandoned the outstanding revisions, and I will mark this a resolved as per comment 13

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Flags: needinfo?(enordin)
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
Target Milestone: 132 Branch → 133 Branch

As the fix landed on mozilla-central, I re-checked on the latest Nightly (133.0a1/20241001155138) under Windows 10 x64, Ubuntu 22.04 LTS and macOS 11.3.1.

The chosen target language persists when closing and reopening the Translations panel, re-confirming the fix.

Setting the bug report as Verified Fixed.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: