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

Small bug with LanguageTool #860

Closed
belug23 opened this issue Apr 11, 2021 · 0 comments · Fixed by #861
Closed

Small bug with LanguageTool #860

belug23 opened this issue Apr 11, 2021 · 0 comments · Fixed by #861
Milestone

Comments

@belug23
Copy link
Contributor

belug23 commented Apr 11, 2021

I've found a bug with the use of LanguageTool that should not cause problems to most people, mostly developers.
When you start manuskript in a fresh python setup, you have no spell checkers. After installing LanguageTool to that setup, starting the app would crash with this error message:

CRITICAL> An unhandled exception has occurred!
Traceback (most recent call last):
  File "bin/manuskript", line 13, in <module>
    main.run()
  File "/home/belug/dev/manuskript/bin/../manuskript/main.py", line 291, in run
    app, MW = prepare(arguments)
  File "/home/belug/dev/manuskript/bin/../manuskript/main.py", line 172, in prepare
    MW = MainWindow()
  File "/home/belug/dev/manuskript/bin/../manuskript/mainWindow.py", line 61, in __init__
    self.setupUi(self)
  File "/home/belug/dev/manuskript/bin/../manuskript/ui/mainWindow.py", line 170, in setupUi
    self.txtSummarySentence = MDEditCompleter(self.tabSummaryPage1)
  File "/home/belug/dev/manuskript/bin/../manuskript/ui/views/MDEditCompleter.py", line 18, in __init__
    dict=dict, autoResize=autoResize)
  File "/home/belug/dev/manuskript/bin/../manuskript/ui/views/MDEditView.py", line 32, in __init__
    autoResize=autoResize)
  File "/home/belug/dev/manuskript/bin/../manuskript/ui/views/textEditView.py", line 83, in __init__
    self._dict = Spellchecker.getDictionary(self.currentDict)
  File "/home/belug/dev/manuskript/bin/../manuskript/functions/spellchecker.py", line 108, in getDictionary
    dictionary = Spellchecker.getDefaultDictionary()
  File "/home/belug/dev/manuskript/bin/../manuskript/functions/spellchecker.py", line 91, in getDefaultDictionary
    default = impl.getDefaultDictionary()
  File "/home/belug/dev/manuskript/bin/../manuskript/functions/spellchecker.py", line 580, in getDefaultDictionary
    default_locale = languagetool.get_locale_language()
AttributeError: module 'language_tool_python' has no attribute 'get_locale_language'

It looks like there's another difference between language_check and language_tool_python the get_locale_language function isn't directly in the LanguageTool module but in the utils submodule.

I already have a fix for it, I'm sending the pull request in a few minutes.

belug23 added a commit to belug23/manuskript that referenced this issue Apr 11, 2021
belug23 added a commit to belug23/manuskript that referenced this issue Apr 11, 2021
@TheJackiMonster TheJackiMonster linked a pull request Apr 11, 2021 that will close this issue
@TheJackiMonster TheJackiMonster added this to the 0.12.0 milestone Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants