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

Side by Side Diff: chrome/common/translate/language_detection_util.cc

Issue 25212002: Bug fix: Translate: CLD2 imcompatibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/translate/language_detection_util.h" 5 #include "chrome/common/translate/language_detection_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 #if !defined(CLD_VERSION) || CLD_VERSION==1 147 #if !defined(CLD_VERSION) || CLD_VERSION==1
148 case 1: 148 case 1:
149 language = 149 language =
150 LanguageCodeWithDialects(static_cast<Language>(cld_language)); 150 LanguageCodeWithDialects(static_cast<Language>(cld_language));
151 break; 151 break;
152 #endif 152 #endif
153 #if !defined(CLD_VERSION) || CLD_VERSION==2 153 #if !defined(CLD_VERSION) || CLD_VERSION==2
154 case 2: 154 case 2:
155 if (cld_language == CLD2::CHINESE) { 155 if (cld_language == CLD2::CHINESE) {
156 language = "zh-CN"; 156 language = "zh-CN";
157 } else if (cld_language == CLD2::CHINESE_T) {
158 language = "zh-TW";
Takashi Toyoshima 2013/10/01 06:20:17 Do you have any reason to handle them as special c
hajimehoshi 2013/10/02 01:13:25 We decided not to update CLD2 for this. I'll add
157 } else { 159 } else {
158 language = 160 language =
159 CLD2::LanguageCode(static_cast<CLD2::Language>(cld_language)); 161 CLD2::LanguageCode(static_cast<CLD2::Language>(cld_language));
160 } 162 }
161 break; 163 break;
162 #endif 164 #endif
163 default: 165 default:
164 NOTREACHED(); 166 NOTREACHED();
165 } 167 }
166 } 168 }
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 case 2: 374 case 2:
373 return CLD2::DetectLanguageVersion(); 375 return CLD2::DetectLanguageVersion();
374 #endif 376 #endif
375 default: 377 default:
376 NOTREACHED(); 378 NOTREACHED();
377 } 379 }
378 return ""; 380 return "";
379 } 381 }
380 382
381 } // namespace LanguageDetectionUtil 383 } // namespace LanguageDetectionUtil
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698