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

Language for languagetool should be taken from spelllang #3360

Open
bratekarate opened this issue Sep 20, 2020 · 3 comments
Open

Language for languagetool should be taken from spelllang #3360

bratekarate opened this issue Sep 20, 2020 · 3 comments

Comments

@bratekarate
Copy link
Contributor

The language for the languagetool spellcheck should be taken form &spelllang, or at least be configurable through another option. It should be quite simple in most cases; If spelllang has 2 characters, just pass them to languagetool. If it has 5, uppercase the last two.

Another variable g:ale_languagetool_lang could override the language, if user's spelllang is not supported by languagetool or differs from their vim spelllang. A Hashmap with languagecode mappings would be another option. Probably more reliable but a little more boilerplate. That is how I did it with textidote, when I adapted the existing PR for my own needs locally.

If using spellang seems to complicated, the variable g:ale_languagetool_lang would be much appreciated.

@oblitum
Copy link
Contributor

oblitum commented Oct 1, 2020

Hey @bratekarate, I see you commit on TeXtidote, are you planning to pick on the work of the stale PRs to add support for it? That would be great as the current support for LanguageTool in ALE is simply not good as LanguageTool standalone isn't correct for checking LaTeX/Markdown. While at that, it would also be great to simply remove markdown from default LanguageTool linter filetype list (simply leaving languagetool for plain text).

@bratekarate
Copy link
Contributor Author

@oblitum I actually made some changes to the PR already in my fork of ale to make textidote work.

Shall I open a new PR for this one?

@bratekarate
Copy link
Contributor Author

bratekarate commented Oct 1, 2020

I opened #3376 for this issue. It's a draft, feedback is welcome. Also have some issues with the linter on the doc files.

The solution works also for the multiple &spelllang case you mentioned in the closed PR. I would rather not get rid of it, as I think that it simplifies configuration in most cases. It is still overridable if you don't want spelllang to be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants