Fixed a bug in language lookup for enchant spelling
This commit is contained in:
+11
-3
@@ -35,6 +35,10 @@ from nw.constants import isoLanguage
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# ================================================================================================ #
|
||||||
|
# SpellChecking SuperClass
|
||||||
|
# ================================================================================================ #
|
||||||
|
|
||||||
class NWSpellCheck():
|
class NWSpellCheck():
|
||||||
|
|
||||||
SP_INTERNAL = "internal"
|
SP_INTERNAL = "internal"
|
||||||
@@ -155,9 +159,13 @@ class NWSpellEnchant(NWSpellCheck):
|
|||||||
|
|
||||||
def listDictionaries(self):
|
def listDictionaries(self):
|
||||||
retList = []
|
retList = []
|
||||||
for spTag, spProvider in enchant.list_dicts():
|
try:
|
||||||
spName = "%s [%s]" % (self.expandLanguage(spTag), spProvider.name)
|
import enchant
|
||||||
retList.append((spTag, spName))
|
for spTag, spProvider in enchant.list_dicts():
|
||||||
|
spName = "%s [%s]" % (self.expandLanguage(spTag), spProvider.name)
|
||||||
|
retList.append((spTag, spName))
|
||||||
|
except:
|
||||||
|
logger.error("Failed to list languages for enchant spell checking")
|
||||||
return retList
|
return retList
|
||||||
|
|
||||||
# END Class NWSpellEnchant
|
# END Class NWSpellEnchant
|
||||||
|
|||||||
Reference in New Issue
Block a user