SelectTranslationsPanel languageInfo cache is not correctly cleared between page loads
Categories
(Firefox :: Translations, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox126 | --- | unaffected |
firefox127 | --- | unaffected |
firefox128 | --- | verified |
firefox129 | --- | verified |
People
(Reporter: nordzilla, Assigned: nordzilla)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Description
Bug 1870368 patch D211230 introduced a cache to the SelectTranslationsPanel
which includes the document's determined language tag.
This cached information is occasionally used in our fallback algorithm for when we detect that the selected text is in a language that is not yet supported by translations. In this case, we check the document's language tag, to see if the page's language is supported, and attempt to fall back to that in case the selected text was misidentified.
This cache was not being properly cleared between page loads, and it causes the panel to fall back to the document language of the previous page in this scenario, rather than the current page.
Steps to reproduce
- Go to a page in a supported language, such as https://fi.wikipedia.org.
- Select a paragraph of text on the page.
- Open the
SelectTranslationsPanel
from the right-click context menu, and ensure that a valid translation completes in the document's language. - Next, navigate to https://ru.wikipedia.org and select the "Welcome to Wikipedia" at the top of the page: "Добро пожаловать в Википедию". Note, it is important to test with this exact string because our current language detector misidentifies this string as Serbian, which we currently do not support.
- Open the
SelectTranslationsPanel
from the right-click context menu.
Expected Behavior
The SelectTranslationsPanel
opens and translates from Russian, based on the current document's language tag.
Actual Behavior
The SelectTranslationsPanel
opens and translates from the previous document's language (Finnish in this STR), based on the previous document's cached language tag.
Steps to implement
- Ensure that the cache is properly cleared between navigating to other pages.
Tests to implement
- Create a test case the reproduces the above situation, and ensure that the fallbacking is for the correct language.
Assignee | ||
Comment 1•4 months ago
|
||
This fixes an issue where the languageInfo cache,
which stores the document's determined language tag
was not correctly being cleared between page loads.
Comment 2•4 months ago
|
||
Set release status flags based on info from the regressing bug 1870368
Comment 4•4 months ago
|
||
bugherder |
Updated•3 months ago
|
Comment 5•3 months ago
|
||
I have reproduced this issue in Nightly v128.0a1 from 2024-05-29 and verified the fix in Beta v128.0b5 and Nightly v129.0a1 from 2024-06-20.
Testing was performed in Windows 10, MacOS 11 and Ubuntu 22.
Description
•