mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: When looking up words in the dictionary for a book that has no language set, use the English dictionary
This commit is contained in:
parent
81bb962465
commit
46c0a9c6b6
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user