Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 860 languagetool get locale language #861

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion manuskript/functions/spellchecker.py
Original file line number Diff line number Diff line change
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