Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Issue 15728002: Translate: adopt html lang attribute if valid value is provided (Closed)

Created:
7 years, 7 months ago by Takashi Toyoshima
Modified:
7 years, 6 months ago
CC:
chromium-reviews, MAD, Ilya Sherman, jar (doing other things), hajimehoshi
Visibility:
Public.

Description

Translate: adopt html lang attribute if valid value is provided Language decision is made by heuristics using Content-Language and CLD determined language. This change adds html lang attribute, e.g., <html lang="ja">, as a third hint for language decision. Content-Language is often invalid due to invalid server configuration. On the other hand, lang attribute is provided by pages, or authoring tools or authors themselves. As a result, they are more reliable than Content-Language. With this change, language decision uses html lang attribute instead of Content-Language if valid value is provided. Other dicision process is not changed at all. BUG=222073 TEST=unit_tests, browser_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201856 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202427 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202531

Patch Set 1 #

Total comments: 4

Patch Set 2 : (rebase) #

Patch Set 3 : review #

Patch Set 4 : nits #

Patch Set 5 : (rebase) #

Patch Set 6 : fix #

Patch Set 7 : fix #

Patch Set 8 : fix WindowOpenClose crash #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -71 lines) Patch
M chrome/renderer/translate/translate_helper.h View 1 chunk +9 lines, -4 lines 0 comments Download
M chrome/renderer/translate/translate_helper.cc View 1 2 3 4 5 6 7 6 chunks +51 lines, -19 lines 0 comments Download
M chrome/renderer/translate/translate_helper_metrics.h View 1 2 3 4 3 chunks +14 lines, -6 lines 0 comments Download
M chrome/renderer/translate/translate_helper_metrics.cc View 1 2 3 4 3 chunks +23 lines, -13 lines 0 comments Download
M chrome/renderer/translate/translate_helper_metrics_unittest.cc View 1 2 3 4 2 chunks +28 lines, -18 lines 0 comments Download
M chrome/renderer/translate/translate_helper_unittest.cc View 3 chunks +27 lines, -4 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 3 chunks +14 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Takashi Toyoshima
Hi Ilya, I'm owner of translate/*, so can you take a look for histgorams OWNERS ...
7 years, 7 months ago (2013-05-22 11:24:03 UTC) #1
Ilya Sherman
https://codereview.chromium.org/15728002/diff/1/chrome/renderer/translate/translate_helper_metrics.cc File chrome/renderer/translate/translate_helper_metrics.cc (right): https://codereview.chromium.org/15728002/diff/1/chrome/renderer/translate/translate_helper_metrics.cc#newcode55 chrome/renderer/translate/translate_helper_metrics.cc:55: UMA_HISTOGRAM_ENUMERATION(metric_name, This won't work as you want it to ...
7 years, 7 months ago (2013-05-22 20:26:17 UTC) #2
Takashi Toyoshima
done https://codereview.chromium.org/15728002/diff/1/chrome/renderer/translate/translate_helper_metrics.cc File chrome/renderer/translate/translate_helper_metrics.cc (right): https://codereview.chromium.org/15728002/diff/1/chrome/renderer/translate/translate_helper_metrics.cc#newcode55 chrome/renderer/translate/translate_helper_metrics.cc:55: UMA_HISTOGRAM_ENUMERATION(metric_name, Thanks. As you said, unit_tests fails on ...
7 years, 7 months ago (2013-05-23 00:37:14 UTC) #3
Ilya Sherman
LGTM, thanks.
7 years, 7 months ago (2013-05-23 08:36:10 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/15728002/27001
7 years, 7 months ago (2013-05-23 08:37:52 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/15728002/27001
7 years, 7 months ago (2013-05-23 17:52:45 UTC) #6
commit-bot: I haz the power
Change committed as 201856
7 years, 7 months ago (2013-05-23 19:28:40 UTC) #7
Takashi Toyoshima
open again because it's reverted.
7 years, 7 months ago (2013-05-27 04:45:38 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/15728002/67001
7 years, 7 months ago (2013-05-27 11:14:37 UTC) #9
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 7 months ago (2013-05-27 11:35:40 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/15728002/80002
7 years, 7 months ago (2013-05-27 11:42:12 UTC) #11
commit-bot: I haz the power
Change committed as 202427
7 years, 6 months ago (2013-05-27 15:00:09 UTC) #12
Takashi Toyoshima
open again. still makes BrowserTest.WindowOpenClose flaky...
7 years, 6 months ago (2013-05-27 16:42:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/15728002/98001
7 years, 6 months ago (2013-05-28 08:36:07 UTC) #14
commit-bot: I haz the power
7 years, 6 months ago (2013-05-28 11:14:24 UTC) #15
Message was sent while issue was closed.
Change committed as 202531

Powered by Google App Engine
This is Rietveld 408576698