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

Side by Side Diff: chrome/browser/translate/translate_manager.cc

Issue 3024005: Google translate supports some new languages, makes Chrome aware of them. Tha... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser/translate/translate_manager.h" 5 #include "chrome/browser/translate/translate_manager.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // am Amharic 55 // am Amharic
56 // bn Bengali 56 // bn Bengali
57 // gu Gujarati 57 // gu Gujarati
58 // kn Kannada 58 // kn Kannada
59 // ml Malayalam 59 // ml Malayalam
60 // mr Marathi 60 // mr Marathi
61 // ta Tamil 61 // ta Tamil
62 // te Telugu 62 // te Telugu
63 const char* kSupportedLanguages[] = { 63 const char* kSupportedLanguages[] = {
64 "af", // Afrikaans 64 "af", // Afrikaans
65 "az", // Azerbaijani
65 "sq", // Albanian 66 "sq", // Albanian
66 "ar", // Arabic 67 "ar", // Arabic
68 "hy", // Armenian
69 "eu", // Basque
67 "be", // Belarusian 70 "be", // Belarusian
68 "bg", // Bulgarian 71 "bg", // Bulgarian
69 "ca", // Catalan 72 "ca", // Catalan
70 "zh-CN", // Chinese (Simplified) 73 "zh-CN", // Chinese (Simplified)
71 "zh-TW", // Chinese (Traditional) 74 "zh-TW", // Chinese (Traditional)
72 "hr", // Croatian 75 "hr", // Croatian
73 "cs", // Czech 76 "cs", // Czech
74 "da", // Danish 77 "da", // Danish
75 "nl", // Dutch 78 "nl", // Dutch
76 "en", // English 79 "en", // English
77 "et", // Estonian 80 "et", // Estonian
78 "fi", // Finnish 81 "fi", // Finnish
79 "fil", // Filipino 82 "fil", // Filipino
80 "fr", // French 83 "fr", // French
81 "gl", // Galician 84 "gl", // Galician
82 "de", // German 85 "de", // German
83 "el", // Greek 86 "el", // Greek
87 "ht", // Haitian Creole
84 "he", // Hebrew 88 "he", // Hebrew
85 "hi", // Hindi 89 "hi", // Hindi
86 "hu", // Hungarian 90 "hu", // Hungarian
87 "is", // Icelandic 91 "is", // Icelandic
88 "id", // Indonesian 92 "id", // Indonesian
89 "it", // Italian 93 "it", // Italian
90 "ga", // Irish 94 "ga", // Irish
91 "ja", // Japanese 95 "ja", // Japanese
96 "ka", // Georgian
92 "ko", // Korean 97 "ko", // Korean
93 "lv", // Latvian 98 "lv", // Latvian
94 "lt", // Lithuanian 99 "lt", // Lithuanian
95 "mk", // Macedonian 100 "mk", // Macedonian
96 "ms", // Malay 101 "ms", // Malay
97 "mt", // Maltese 102 "mt", // Maltese
98 "nb", // Norwegian 103 "nb", // Norwegian
99 "fa", // Persian 104 "fa", // Persian
100 "pl", // Polish 105 "pl", // Polish
101 "pt", // Portuguese 106 "pt", // Portuguese
102 "ro", // Romanian 107 "ro", // Romanian
103 "ru", // Russian 108 "ru", // Russian
104 "sr", // Serbian 109 "sr", // Serbian
105 "sk", // Slovak 110 "sk", // Slovak
106 "sl", // Slovenian 111 "sl", // Slovenian
107 "es", // Spanish 112 "es", // Spanish
108 "sw", // Swahili 113 "sw", // Swahili
109 "sv", // Swedish 114 "sv", // Swedish
110 "th", // Thai 115 "th", // Thai
111 "tr", // Turkish 116 "tr", // Turkish
112 "uk", // Ukrainian 117 "uk", // Ukrainian
118 "ur", // Urdu
113 "vi", // Vietnamese 119 "vi", // Vietnamese
114 "cy", // Welsh 120 "cy", // Welsh
115 "yi", // Yiddish 121 "yi", // Yiddish
116 }; 122 };
117 123
118 const char* const kTranslateScriptURL = 124 const char* const kTranslateScriptURL =
119 "http://translate.google.com/translate_a/element.js?" 125 "http://translate.google.com/translate_a/element.js?"
120 "cb=cr.googleTranslate.onTranslateElementLoad"; 126 "cb=cr.googleTranslate.onTranslateElementLoad";
121 const char* const kTranslateScriptHeader = 127 const char* const kTranslateScriptHeader =
122 "Google-Translate-Element-Mode: library"; 128 "Google-Translate-Element-Mode: library";
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( 575 TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate(
570 TabContents* tab) { 576 TabContents* tab) {
571 for (int i = 0; i < tab->infobar_delegate_count(); ++i) { 577 for (int i = 0; i < tab->infobar_delegate_count(); ++i) {
572 TranslateInfoBarDelegate* delegate = 578 TranslateInfoBarDelegate* delegate =
573 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); 579 tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate();
574 if (delegate) 580 if (delegate)
575 return delegate; 581 return delegate;
576 } 582 }
577 return NULL; 583 return NULL;
578 } 584 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698