Fix 860 languagetool get locale language (#861)

* Fix #860 missing get_locale_language on languagetool

* Update spellchecker.py

Co-authored-by: Tobias Frisch <thejackimonster@gmail.com>
This commit is contained in:
Alexandre 2021-04-11 08:31:06 -04:00 committed by GitHub
parent 49f0c298c3
commit 4107c48ea9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):
@ -577,7 +583,7 @@ class LanguageToolDictionary(BasicDictionary):
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