-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
How do I spell-check multiple languages? #21
Comments
@edward-martyr What do you mean with "multiple languages?" Do you have multiple languages in one workspace, but all the files are single-language each? Or do you have multiple languages in one file? In the former case, you can use VS Code's multi-root workspace feature to have different settings (which include In the latter case, you're out of luck, LT doesn't have multilingual support right now. |
@valentjn Thanks for the comment. In most cases, I work with multiple languages, each in a separate project, so that helps a lot. However, there are occasions where I work with Chinese and Japanese, or English and Chinese in a single file. I guess I'll have to wait until any relevant updates. |
Especially considering that Chinese and Japanese share the same script, it would be hard to differentiate and spell-check them simultaneously. It would be much easier in the case of English and Chinese. |
So LT has the concept of "alternative languages," which means that if a word is unknown in the main language, then the word will be looked up in these alternative languages. If it's in one of those, then there won't be a spelling error. However, I'm a bit reluctant to implement this. This would only be about spell checking, not grammar checking. And the current architecture of LTEX is focused on single languages - each language has its own user dictionary and optionally additional rules from neural networks or Word2Vec. I could also imagine the consumption of resources (CPU, memory) would increase even further for keeping these languages in memory. So this would be a big change, and then you don't even have grammar checking. I'll mark this issue as |
We could :
|
@St-Ex-savadenn I think the current scope of the issue is having multiple languages in a single file. If your files are in one language each, and in different folders, then you can use multiple A possibility to cope with multiple languages in one file could be magic comments. Something like Just for the record, LanguageTool has a built-in language detection via https://github.com/optimaize/language-detector. It's based on n-grams, so it's very fast. Downside is that it only gives you generic languages like |
@valentjn What do you mean by |
@noelmace Sorry, I meant |
The code for magic comments is now in |
Fix released in 5.0.0. |
For those coming from google, if you put If I have a single sentence in english it doesn't give me errors, but if I have a english word on a portuguese brazilian sentence it gives me the "estrangeirismo" error, which is when you use a word outside the language to describe something. Granted it's not perfect, some english phrases have the "estrangeirismo" error still but it's not everything if you set the language to just pt-BR. TIP: You can create a .vscode folder and a settings.json file inside that folder to keep this setting only to that project, while having a main language in your standard settings.json for your other projects. |
Describe the solution you'd like
Being able to assign a list of languages to ltex.language, e.g., "ltex.language": ["en-GB", "zh-CN"]
The text was updated successfully, but these errors were encountered: