Lines Matching defs:language

28 // Similar language code list. Some languages are very similar and difficult
43 int GetSimilarLanguageGroupCode(const std::string& language) {
45 if (language.find(kSimilarLanguageCodes[i].code) != 0)
60 // Applies a series of language code modification in proper order.
85 // Returns the ISO 639 language code of the specified |text|, or 'unknown' if it
90 std::string language = translate::kUnknownLanguageCode;
134 // reliable, or if the actual text used to detect the language was less than
137 // the determined language code is correct with 50% confidence. Chrome should
142 // language code for tradtional Chinese among others.
149 language =
161 // CLD2::CHINESE_T. This is technically more precise for the language
165 language = "zh-CN";
167 language = "zh-TW";
169 language =
178 VLOG(9) << "Detected lang_id: " << language << ", from Text:\n" << text
180 return language;
183 // Checks if CLD can complement a sub code when the page language doesn't know
188 // CLD agree that the language is Chinese and Content-Language doesn't know
189 // which dialect is used, CLD language has priority.
220 VLOG(9) << "html lang based language code: " << modified_html_lang;
233 std::string language = modified_html_lang.empty() ? modified_code :
236 // If |language| is empty, just use CLD result even though it might be
238 if (language.empty()) {
247 return language;
250 if (CanCLDComplementSubCode(language, cld_language)) {
256 if (IsSameOrSimilarLanguages(language, cld_language)) {
259 return language;
262 if (MaybeServerWrongConfiguration(language, cld_language)) {
269 // written in another language with confidence. In this case, Chrome doesn't
270 // rely on any of the language codes, and gives up suggesting a translation.
281 // There are more than 1 language specified, just keep the first one.
302 // Roughly check if the language code follows /[a-zA-Z]{2,3}(-[a-zA-Z]{2})?/.
303 // TODO(hajimehoshi): How about es-419, which is used as an Accept language?
361 // Check if |page_language| and |cld_language| are in the similar language
362 // list and belong to the same language group.
377 // A server provides a language meta information representing "en-*". But it
379 // Let's trust |cld_language| if the determined language is not difficult to
380 // distinguish from English, and the language is one of well-known languages