Skip to content

Commit

Permalink
Fix 860 languagetool get locale language (#861)
Browse files Browse the repository at this point in the history
* Fix #860 missing get_locale_language on languagetool

* Update spellchecker.py

Co-authored-by: Tobias Frisch <thejackimonster@gmail.com>
  • Loading branch information
belug23 and TheJackiMonster committed Apr 11, 2021
1 parent 49f0c29 commit 4107c48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manuskript/functions/spellchecker.py
Expand Up @@ -530,6 +530,12 @@ def get_languagetool_languages():
else:
return languagetool.LanguageTool()._get_languages()

def get_languagetool_locale_language():
if use_language_check:
return languagetool.get_locale_language()
else:
return languagetool.utils.get_locale_language()

class LanguageToolDictionary(BasicDictionary):

def __init__(self, name):
Expand Down Expand Up @@ -577,7 +583,7 @@ def getDefaultDictionary():
if not LanguageToolDictionary.isInstalled():
return None

default_locale = languagetool.get_locale_language()
default_locale = get_languagetool_locale_language()

if default_locale and not default_locale in get_languagetool_languages():
default_locale = None
Expand Down

0 comments on commit 4107c48

Please sign in to comment.