Skip to content

Commit

Permalink
Adding metrics comparing Accept-Language with xml:lang and HTML lang
Browse files Browse the repository at this point in the history
values.

A follow-up Cl for https://crrev.com/c/3513984, as the majority of sites
do not send the Content-Language in the response header.
Instead, sites try to use the html `lang` tag to indicate the document
language.

We are trying to record the values of the language tags to the
Accept-Language header to determine:
* How many page loads have xml:lang or html lang match one of the
accepted languages?
* How many page loads have xml:lang or html lang match the top-most
preferred language?

Why WebLanguageDetectionDetails:
WebLanguageDetectionDetails can easily access html lang and `xml:lang`
attribute value. Also, we can read the Accept-Language from Prefs
efficiently.

Proposal doc:
[Limited to Google employees] https://docs.google.com/document/d/1bDaCMJP9w6VJjlM_5nRO1KxyB2fkV3JRtKkfUS0GJ_Y

Other doc:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang

Bug: 1304818
Change-Id: I7d6c7c03e0f44405939273d944aa6a21ac515e40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3553383
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Max Curran <curranmax@chromium.org>
Reviewed-by: Trevor Perrier <perrier@chromium.org>
Reviewed-by: Ali Beyad <abeyad@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988628}
  • Loading branch information
Tanych authored and Chromium LUCI CQ committed Apr 4, 2022
1 parent 71487f2 commit 47cea9a
Show file tree
Hide file tree
Showing 7 changed files with 581 additions and 3 deletions.

0 comments on commit 47cea9a

Please sign in to comment.