| 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();
|
| },
|
|
|
|
|