emacs-languagetool / flycheck-languagetool

Flycheck support for LanguageTool
GNU General Public License v3.0
55 stars 9 forks source link

[Feature request] Select language to check #28

Open morgandavidson opened 1 year ago

morgandavidson commented 1 year ago

Here is my config (which works fine):

  (use-package flycheck-languagetool
    :hook
    (text-mode . flycheck-languagetool-setup)
    (org-mode . flycheck-languagetool-setup)
    (latex-mode . flycheck-languagetool-setup)
    (markdown-mode . flycheck-languagetool-setup)
    :init
    (setq flycheck-languagetool-url "https://api.languagetool.org")
    (setq flycheck-languagetool-server-jar nil)
    (setq flycheck-languagetool-server-port nil)
    (setq flycheck-languagetool-language "fr-FR")
    :config
    (add-to-list 'flycheck-checkers 'languagetool)
    )

How could I add (setq flycheck-languagetool-language "en-US") ?

jcs090218 commented 1 year ago

You mean to check with multiple languages in a file? 🤔 I haven't use language-tool for a while, so I don't know if that is possible.

morgandavidson commented 1 year ago

I mean being able to use LanguageTool french checker in a buffer when I'm writing in French. And being able to use LanguageTool English checker in another buffer when I'm writing in English.

jcs090218 commented 1 year ago

No, unfortunately, there is no default way to do this. You will have to set it yourself,

(setq-local flycheck-languagetool-language "en-US")

in France buffer,

(setq-local flycheck-languagetool-language "fr-FR")
morgandavidson commented 1 year ago

Thank you, M-: (setq-local flycheck-languagetool-language "en-US") or M-: (setq-local flycheck-languagetool-language "fr-FR") work fine within buffer.

Could the following functionality be added as an enhancement request?

To be able to have multiple LanguageTool checkers options when in flycheck-select-checked (e.g. en-US, fr-FR, etc.).

jcs090218 commented 1 year ago

Could the following functionality be added as an enhancement request?

To be able to have multiple LanguageTool checkers options when in flycheck-select-checked (e.g. en-US, fr-FR, etc.).

You mean the interface to select language before starting the checker?

morgandavidson commented 1 year ago

I mean, the ability to choose between FR, EN or else, here: https://paste.pics/MJ2L7

jcs090218 commented 1 year ago

Of course, I will find some time to implement this! :D

morgandavidson commented 1 year ago

Awesome, thank you!