Closed Bug 1859081 Opened 2 years ago Closed 10 months ago

Run language detection before offering a translation (dxomark.com website detected as being French)

Categories

(Firefox :: Translations, defect, P3)

Firefox 118
defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: aros, Assigned: gregtatum)

References

(Blocks 2 open bugs)

Details

(Keywords: perf-alert)

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

Firefox needlessly offers to translate it from French to English which doesn't make any sense.

I'm using Firefox 118.0.2 (the official build) under Linux.

I've forgotten to specify the exact URL, it's https://www.dxomark.com/smartphones/#sort-camera

Component: Untriaged → Translation

view-source:https://www.dxomark.com/smartphones/#sort-camera

See the first two lines are

<!DOCTYPE html>
<html lang="fr">

So this is a problem with the website that the owners would need to fix.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID

In the translations meeting we discussed a change in strategy to address issues like this.

Our new language detection strategy will be:

  • If there is no language tag - run language detection
  • If the language tag should not offer a translation - do not run language detection
  • If the language tag should offer a translation - run the language detection as well

Then if language detection runs:

  1. langtag is empty: use language detection result
  2. langtag and detection agree: offer translation
  3. langtag and detection disagree: do not offer translation
    a. If langtag or detected language are supported, still show the translations icon without pop-up When pop-up is opened, show "Choose a language" as the from-language.
    b. If neither langtag nor detected language are supported, do not show the icon.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Summary: dxomark.com website detected as being French → Run language detection before offering a translation (dxomark.com website detected as being French)
Severity: -- → S3
Priority: -- → P3
Blocks: 1861698
See Also: → 1863570
Duplicate of this bug: 1867995

It would be worth verifying the fix on this case as well: Bug 1859081

(In reply to Greg Tatum [:gregtatum] from comment #3)

In the translations meeting we discussed a change in strategy to address issues like this.

Our new language detection strategy will be:

  • If there is no language tag - run language detection
  • If the language tag should not offer a translation - do not run language detection
  • If the language tag should offer a translation - run the language detection as well

Then if language detection runs:

  1. langtag is empty: use language detection result
  2. langtag and detection agree: offer translation
  3. langtag and detection disagree: do not offer translation
    a. If langtag or detected language are supported, still show the translations icon without pop-up When pop-up is opened, show "Choose a language" as the from-language.

I found this "bug" while trying to report Firefox stable&nightly suggesting to translate from Italian to English (my locale) at https://fing.com

When I check the page source first lines are:
<!DOCTYPE html>
<html lang="it" class="sk-device--desktop" data-lang="it">

which is clearly a bug at website and reported. However, it also means the detection does detect it as Italian as well.

Attached file fing.html

Snapshot of https://fing.com ' curl https://www.fing.com >fing.html' ( current UNIX time 1709783987 )

Duplicate of this bug: 1892559
Duplicate of this bug: 1895066
Duplicate of this bug: 1924611
Assignee: nobody → gtatum

We developed the new translations codebase using an "s" at the end, and
retained the old translations code under "translation". At this point
I'm unifying it so that it's all under "translations", which involves a
rename of the existing code. This way we will be consistent in our
naming practice.

Pushed by gtatum@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6161eefa0f56 Move cld2 from toolkit/component/translation to translations; r=translations-reviewers,zeid,frontend-codestyle-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/4cb35ecb38ab Modernize the languge detector code; r=translations-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/751dd406e9d9 Do not offer a translation when the lang tag and identified language mismatch; r=translations-reviewers,nordzilla
Status: REOPENED → RESOLVED
Closed: 2 years ago10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch

This has lead to regressions on some tests on Linux with:
14% on rasterflood_gradient
11.5% on rasterflood_gradient software-webrender

(regressions are still being validated by the perf-sheriffs, but the backfills point out this bug as the regressor.)

Regressions: 1951367

The page for rasterflood_gradient doesn't include a language tag, which means that translations code will run on the page. However we disabled the translation behavior in automation to reduce false positives like this. If I had a performance profile for it I could confirm. Edit: investigating in Bug 1951367

(In reply to Pulsebot from comment #14)

Pushed by gtatum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6161eefa0f56
Move cld2 from toolkit/component/translation to translations;
r=translations-reviewers,zeid,frontend-codestyle-reviewers,nordzilla
https://hg.mozilla.org/integration/autoland/rev/4cb35ecb38ab
Modernize the languge detector code; r=translations-reviewers,nordzilla
https://hg.mozilla.org/integration/autoland/rev/751dd406e9d9
Do not offer a translation when the lang tag and identified language
mismatch; r=translations-reviewers,nordzilla

Perfherder has detected a browsertime performance change from push 751dd406e9d909f414c8d4263352f7f90983fa1c.

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
10% vpl-vp9 estimatedFirstFrameLatency macosx1470-64-shippable cold fission webrender 183.75 -> 164.92
10% vpl-vp9 firstFrame macosx1470-64-shippable cold fission webrender 183.75 -> 164.92
10% facebook-nav.landing FirstVisualChange linux1804-64-shippable-qr cold fission webrender 791.50 -> 712.37
8% facebook-nav.landing ContentfulSpeedIndex linux1804-64-shippable-qr cold fission webrender 868.47 -> 795.62
8% facebook-nav.landing PerceptualSpeedIndex linux1804-64-shippable-qr cold fission webrender 880.96 -> 813.24
... ... ... ... ... ...
5% vpl-h264 firstFrame linux1804-64-shippable-qr cold fission webrender 171.73 -> 162.71 Before/After

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 44129

For more information on performance sheriffing please see our FAQ.

Keywords: perf-alert
Blocks: 1953881
See Also: → 1967758
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: