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

Unified Diff: chrome/browser/resources/translate.js

Issue 15295004: Translate: enable against unknown languages with server side detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebase for dcommit) Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/translate.js
diff --git a/chrome/browser/resources/translate.js b/chrome/browser/resources/translate.js
index 07f7113c19098a9aa32ea8a556b26f867bc9702e..df7437be1dc7b2bb9af5b190c2240f6e5e082731 100644
--- a/chrome/browser/resources/translate.js
+++ b/chrome/browser/resources/translate.js
@@ -130,11 +130,15 @@ cr.googleTranslate = (function(key) {
* The language the page translated was in. Is valid only after the page
* has been successfully translated and the original language specified to
* the translate function was 'auto'. Is empty otherwise.
+ * Some versions of Element library don't provide |getDetectedLanguage|
+ * function. In that case, this function returns 'und'.
* @type {boolean}
*/
get sourceLang() {
if (!libReady || !finished || error)
return '';
+ if (!lib.getDetectedLanguage)
+ return 'und'; // defined as chrome::kUnknownLanguageCode in C++ world.
return lib.getDetectedLanguage();
},
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698