py3 compat: Fix sorting in spell check dialog on language broken for books that have unknown languages

This commit is contained in:
Kovid Goyal 2021-05-24 17:02:13 +05:30
parent bf119f0cf1
commit aebe0f1f86
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -698,7 +698,7 @@ class WordsModel(QAbstractTableModel):
elif col == 2:
def key(w):
locale = w[1]
return (calibre_langcode_to_name(locale.langcode), locale.countrycode)
return (calibre_langcode_to_name(locale.langcode) or ''), (locale.countrycode or '')
else:
key = self.misspelled_text
return key