From 46c0a9c6b6d4515bf9ff7df3c4064fd11c175446 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Oct 2014 00:50:02 +0530 Subject: [PATCH] E-book viewer: When looking up words in the dictionary for a book that has no language set, use the English dictionary --- src/calibre/gui2/viewer/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index c5f28ddcab..b5d1551b70 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -53,13 +53,15 @@ class RecentAction(QAction): def default_lookup_website(lang): lang = lang_as_iso639_1(lang) or lang - if lang == 'en': + if lang in ('und', 'en'): prefix = 'https://www.wordnik.com/words/' else: prefix = 'http://%s.wiktionary.org/wiki/' % lang return prefix + '{word}' def lookup_website(lang): + if lang == 'und': + lang = 'en' wm = dprefs['word_lookups'] return wm.get(lang, default_lookup_website(lang))