Bug 156490 - LanguageTool checker refuses to work until LO is restarted
Summary: LanguageTool checker refuses to work until LO is restarted
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 158730 (view as bug list)
Depends on:
Blocks: LanguageTool
  Show dependency treegraph
 
Reported: 2023-07-27 13:08 UTC by medmedin2014
Modified: 2023-12-17 06:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Language Options Archlinux (84.61 KB, image/png)
2023-07-28 11:07 UTC, medmedin2014
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medmedin2014 2023-07-27 13:08:47 UTC
Even if I enable LanguageTool in Options, then apply and close Options window, if I check it again I always find “LanguageTool Remote Grammar Checker” disabled. This happens both for remote https://api.languagetool.org/v2 and local LanguageTool servers. Typed text is not checked with LanguageTool no matter what I do.

NB: Firefox is working fine with both remote and local LanguageTool servers.

Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 2; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
7.5.5-1
Calc: threaded

Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 6.4.6-1-MANJARO (64-bit)
Graphics Platform: Wayland
Comment 1 Stéphane Guillou (stragu) 2023-07-27 19:41:35 UTC Comment hidden (obsolete)
Comment 2 medmedin2014 2023-07-27 21:38:37 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> Have you followed these steps to set it up?
> https://languagetool.org/insights/post/product-libreoffice/#how-to-enable-
> languagetool-on-libreoffice

I followed the same steps, the problem is: the checkbox of "LanguageTool Remote Grammar Checker" in "Options>Languages Settings>Writing Aids" always resets itself as disabled even if I previously enabled it.
Comment 3 medmedin2014 2023-07-27 22:05:25 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> Have you followed these steps to set it up?
> https://languagetool.org/insights/post/product-libreoffice/#how-to-enable-
> languagetool-on-libreoffice

Well, I re-tested on a fresh Archlinux machine, and it seems after enabling LanguageTool and its grammar checker, LO needs to be restarted and all start to work fine.
Comment 4 Stéphane Guillou (stragu) 2023-07-27 22:55:42 UTC Comment hidden (obsolete)
Comment 5 Mike Kaganski 2023-07-28 09:57:52 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Setting to "works for me", please let us know if the issue pops up again.

It is not a WFM, because there is a real issue: the setting in the options requires a restart, but it is not reported to user. Cf. to enabling Skia, where a dialog appears, telling "Do you want to restart LibreOffice now? For the Skia changes to take effect, LibreOffice must be restarted".

Alternatively, LanguageTool connection implementation should be improved to not require a restart - but that is a larger task.
Comment 6 Stéphane Guillou (stragu) 2023-07-28 10:30:53 UTC
I haven't noticed the need to restart for it to work, although I have always had a hard time making LT work...
Can you reproduce the need for a restart yourself?

One issue I've noticed though is how Lightproof interferes with it.

Testing with 7.5.5.2:

1. Open Writer with new profile
2. Type "5 pm in the afternoon" in the document (my document is in English-AU)
3. Options > Language Settings > Writing aids: notice how Lightproof is on.
4. Follow instructions: https://languagetool.org/insights/post/product-libreoffice/#how-to-enable-languagetool-on-libreoffice
5. Continue editing document

Result 1: LanguageTool is not working

6. Options > Language Settings > Writing aids: turn of Lightproof, click OK

Result 2: LanguageTool works.

I didn't need a restart.
Mike, do you see the same Lightproof/LT interference?
Comment 7 Stéphane Guillou (stragu) 2023-07-28 10:32:11 UTC
See: https://github.com/languagetool-org/languagetool/issues/193
Comment 8 medmedin2014 2023-07-28 10:45:49 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)

> I didn't need a restart.

Can you test by following these steps:

1) Close all LO instances
2) Remove LO config folder "/home/username/.config/libreoffice"
3) Start Writer
4) Open "Options>Language Settings>LanguageTool Server" and enable LanguageTool
5) Go to "Writing Aids" and enable "LanguageTool Remote Grammar Checker"
6) Click "Apply" and close Options window
7) Try typing some text and see if LO works

At this step LanguageTool doesn't work, and I need to restart LO to make it working.
Comment 9 Stéphane Guillou (stragu) 2023-07-28 10:55:46 UTC
(In reply to medmedin2014 from comment #8)
> Can you test by following these steps:
> 
> 1) Close all LO instances
> 2) Remove LO config folder "/home/username/.config/libreoffice"
> 3) Start Writer
> 4) Open "Options>Language Settings>LanguageTool Server" and enable
> LanguageTool
> 5) Go to "Writing Aids" and enable "LanguageTool Remote Grammar Checker"
> 6) Click "Apply" and close Options window
> 7) Try typing some text and see if LO works

I tried you steps:
- I needed to click OK and reopen the dialog after step 4, otherwise no checkbox in Writing Aids (which matches the linked instructions)
- LT does not work at before nor after a restart
- The LT writing aid checkbox remains ticked after a restart
- only turning off Lightproof makes LT functional

So I still can't see anything related to restarting LO. I only see Lightproof interfering.
Comment 10 medmedin2014 2023-07-28 11:07:54 UTC
Created attachment 188608 [details]
Language Options Archlinux

I'm using both Manjaro and Archlinux with same LO v7.5.5.2, and in Writing Aids I don't see that Lightproof
Comment 11 Stéphane Guillou (stragu) 2023-07-28 11:29:15 UTC
Thanks medmedin. Well, if someone else can reproduce that need for a restart, let's turn this into a confirmed bug.
Comment 12 Mike Kaganski 2023-07-28 12:44:58 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> Mike, do you see the same Lightproof/LT interference?

Yes, indeed: there can only be one grammar checker active for any single language, and Lightproof gets picked first, when enabled.

(In reply to Stéphane Guillou (stragu) from comment #9)
> So I still can't see anything related to restarting LO. I only see
> Lightproof interfering.

Me too.

Testing:
0. Start with a clean profile;
1. Create a new Writer document;
2. Type 'dt[F3]' to have an English dummy text with known LanguageTool indications (make sure it has en-US);
3. Open Options->Language Settings->LanguageTool Server, and check the "Enable LanguageTool" checkbox -> OK;
4. Open Options->Language Settings->Writing Aids; uncheck all Lightproof entries, and enable the LanguageTool entry -> OK.

In my testing using 7.6.0.1 on Windows 10, I see that this immediately results in LanguageTool checking text (the following elements get underlined with orange: "lightning", "warehouses", "he"). Note that at no stage I needed a restart - even no document reload was required.
Comment 13 medmedin2014 2023-07-28 14:10:46 UTC
(In reply to Mike Kaganski from comment #12)
> (In reply to Stéphane Guillou (stragu) from comment #6)
> > Mike, do you see the same Lightproof/LT interference?
> 
> Yes, indeed: there can only be one grammar checker active for any single
> language, and Lightproof gets picked first, when enabled.


On Linux LO doesn't come bundled with Lightproof, I only see Hunspell, Libhyphen and Mythes Thesaurus.
I don't know if it's a problem unique to LO on Linux or you should remove Lightproof to check it.
Comment 14 Mike Kaganski 2023-07-28 14:39:09 UTC
I repro on Windows, when Lightproof is removed. To do that, before step 0 in comment 12, I renamed Lightproof.components and Linguistic.xcu in <instdir>share\extensions\dict-en and share\extensions\dict-ru (these were the only directories containing lightproof configuration data here). Then, enabling LanguageTool server, and then enabling it in Writing Aids, didn't work - possibly because the whole component wasn't enabled, unlike when Lightproof was present.

Despite reproducing on Windows, I do not change the respective meta field, because the likely affected systems are Linux. But the steps would allow to repro, debug and fix using any platform.
Comment 15 steve 2023-12-17 06:28:46 UTC
*** Bug 158730 has been marked as a duplicate of this bug. ***