summaryrefslogtreecommitdiffstats
path: root/components/translate
diff options
context:
space:
mode:
authorscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 17:16:01 +0000
committerscheib@chromium.org <scheib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 17:16:01 +0000
commit515cb845cd71b9ad35e325b7202b9dff8ad13052 (patch)
treee4cb6236547fbec173b143427e47cf76da112d20 /components/translate
parente1272045536e5261a8d5565d1eed08b32f8314cf (diff)
downloadchromium_src-515cb845cd71b9ad35e325b7202b9dff8ad13052.zip
chromium_src-515cb845cd71b9ad35e325b7202b9dff8ad13052.tar.gz
chromium_src-515cb845cd71b9ad35e325b7202b9dff8ad13052.tar.bz2
Revert of Use TOP #1 language from CLD2 instead of the summary language (https://codereview.chromium.org/75483009/)
Reason for revert: check licenses script failed and turned tree red: http://build.chromium.org/p/chromium/builders/Linux/builds/48235/steps/check_licenses/logs/stdio python src/tools/checklicenses/checklicenses.py --root src in dir /b/build/slave/Linux/build (timeout 600 secs) (maxTime 28800 secs) watching logfiles {} argv: ['python', 'src/tools/checklicenses/checklicenses.py', '--root', 'src'] environment: AWS_CREDENTIAL_FILE=/b/build/site_config/.boto BOTO_CONFIG=/b/build/site_config/.boto CHROME_HEADLESS=1 DISPLAY=:0.0 HOME=/home/chrome-bot LANG=en_US.UTF-8 LOGNAME=chrome-bot PAGER=cat PATH=/home/chrome-bot/slavebin:/b/depot_tools:/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin PWD=/b/build/slave/Linux/build PYTHONPATH=/b/build/site_config:/b/build/scripts:/b/build/scripts/release:/b/build/third_party:/b/build_internal/site_config:/b/build_internal/symsrc:/b/build/slave:/b/build/third_party/buildbot_slave_8_4:/b/build/third_party/twisted_10_2: SHELL=/bin/bash USER=chrome-bot using PTY: False Using base directory: src Checking: src 'third_party/cld_2/src/internal/cld2_generated_deltaoctachrome0122.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_quadchrome0122_19.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_quadchrome0122_16.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_quadchrome0122_2.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_distinctoctachrome0122.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_deltaocta0122.cc' has non-whitelisted license 'UNKNOWN' 'third_party/cld_2/src/internal/cld2_generated_distinctocta0122.cc' has non-whitelisted license 'UNKNOWN' FAILED Please read http://www.chromium.org/developers/adding-3rd-party-libraries for more info how to handle the failure. Original issue's description: > Use TOP #1 language from CLD2 instead of the summary language > > The summary language and the top language are different, and the top language should be used for Translate. Originally, Chromium adopts the top language of CLD1, and summary language of CLD2. This CL fixes to use the top language even in the case of CLD2. > > BUG=320362 > TEST=manual > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236228 TBR=toyoshim@chromium.org,hajimehoshi@chromium.org NOTREECHECKS=true NOTRY=true BUG=320362 Review URL: https://codereview.chromium.org/200453005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/translate')
-rw-r--r--components/translate/language_detection/language_detection_util.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/translate/language_detection/language_detection_util.cc b/components/translate/language_detection/language_detection_util.cc
index b452549..f87d814 100644
--- a/components/translate/language_detection/language_detection_util.cc
+++ b/components/translate/language_detection/language_detection_util.cc
@@ -113,10 +113,9 @@ std::string DetermineTextLanguage(const base::string16& text,
std::string utf8_text(base::UTF16ToUTF8(text));
CLD2::Language language3[3];
int percent3[3];
- CLD2::DetectLanguageSummary(
+ cld_language = CLD2::DetectLanguageSummary(
utf8_text.c_str(), (int)utf8_text.size(), true, language3, percent3,
&text_bytes, &is_reliable);
- cld_language = language3[0];
is_valid_language = cld_language != CLD2::NUM_LANGUAGES &&
cld_language != CLD2::UNKNOWN_LANGUAGE &&
cld_language != CLD2::TG_UNKNOWN_LANGUAGE;