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

Spelling in two languages #81

Closed
robgal519 opened this issue Jul 22, 2020 · 7 comments
Closed

Spelling in two languages #81

robgal519 opened this issue Jul 22, 2020 · 7 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@robgal519
Copy link

Hi, I'm writing my master thesis, and I use a lot of English phrases, because of technical nature of my paper.
Is there a way to include second dictionary?

I do not really care for the grammar of the secondary language. I just get a lot of errors every time, I want to create a footnote with English translation of the term I was working on.
Because I do not need grammar this should make it easier for you to implement I hope.

The other possible solution would be to disable checking the dictionary, and I could then add third party tool to check for the spelling

Currently, I add all the words to my local dictionary in config, but I have to check every word before adding, and it is just annoying.

@robgal519 robgal519 added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label Jul 22, 2020
@valentjn
Copy link
Owner

Why not use magic comments together with language-specific dictionaries (you can have two at the same time)? Also see this question in the FAQ.

@robgal519
Copy link
Author

Well, I could use magic comments, but it would add bloat to my text. Let's consider an example:

... dokumentacji możemy odnaleźć opis modułu FSMC (ang. Flexible Static Memory Controller), który służy do adresowania zewnętrznej pamięci. ...

It would need to become:

... dokumentacji możemy odnaleźć opis modułu FSMC 
% LTeX: language=en-US
(ang. Flexible Static Memory Controller),
% LTeX: language=pl-PL
 który służy do adresowania zewnętrznej pamięci. ...

This forced me to split the line, and add two commands around the foreign sentence. Where I just wanted to get rid of the squiggle line stating that it is not a valid word in Polish. If I could simply import English dictionary into Polish, it would solve my issue

@valentjn
Copy link
Owner

valentjn commented Jul 24, 2020

I see. But I'm not sure how the solution you propose would look like.

You say you want to "import English dictionary into Polish". So I assume you don't want to have spelling errors for any English words in your Polish document. But that would mean you could take a document that's completely in English, spell-check it while having the language set to Polish, and then there would be no spelling errors at all. That's clearly not desirable.

Actually, LanguageTool had a similar feature in versions 4.4 to 4.9.1, marked as experimental and called "alternative languages", see this thread. However, it caused more problems than it solved, so it was removed in LT 5.0.

Since you're using LATEX, I think the proper way would be to use babel commands like \foreignlanguage to indicate the languages used, which you should do in any case as otherwise hyphenation of the English words will be wrong in your thesis. LTEX doesn't support these commands yet, and it's not quite easy to implement this. But it's possible. (If you wanted automatic multilingual support instead, that wouldn't be in LTEX's scope, but in LanguageTool's.)

In the meantime, since you said it's annoying to add words to the dictionary, remember that you can add multiple words at once. Just select text that contains the words and execute the Add all unknown words in selection to dictionary quickfix (Ctrl+.).

@robgal519
Copy link
Author

Thank you for the comment, I did not expect that this would create such problems. I did not know that I need to use \foreignlanguage, I will definitely incorporate this to my thesis, and I will use magic comments to change language for ltex ( I created simple snippet, so it is not as much annoying)

valentjn added a commit to valentjn/ltex-ls that referenced this issue Jul 25, 2020
@valentjn valentjn self-assigned this Jul 25, 2020
@valentjn valentjn added this to the 6.1.0 milestone Jul 25, 2020
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Jul 25, 2020
@valentjn
Copy link
Owner

valentjn commented Jul 25, 2020

There's a reason why the 15-year old LanguageTool still doesn't really support multilingual documents; because it's not easy 😉

I implemented support for babel commands for LTEX and it seems to work quite nicely. Look here for a sneak preview of the syntax. It's going to be in the upcoming feature release.

@valentjn
Copy link
Owner

Fix released in 6.1.0.

@ainar
Copy link

ainar commented Aug 16, 2023

Can you please add support to the csquotes package?
Like \foreignblockquote or \foreigncblockquote.

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

3 participants