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

How should available languages for spellchecking be communicated? #1226

Open
Cogitri opened this issue Aug 31, 2019 · 11 comments
Open

How should available languages for spellchecking be communicated? #1226

Cogitri opened this issue Aug 31, 2019 · 11 comments

Comments

@Cogitri
Copy link
Member

Cogitri commented Aug 31, 2019

So while trying to add the spellchecking plugin I've noticed that we don't really have a way to communicate what language to choose. Since available_languages talks about programming languages/syntaxes and not languages as in English/German and so on we can't really use that, I think (since syntax selection shouldn't clasg with language selection, you could totally want rust as syntax and still select English has language to correct comments).

@cmyr

@cmyr
Copy link
Member

cmyr commented Sep 3, 2019

basically: I hope we can not deal with this. The spellcheck plugin itself should determine the user's current locale & language settings, and respect that.

@Cogitri
Copy link
Member Author

Cogitri commented Sep 3, 2019

Huh, but what about users who want to write in foreign languages? Or do you mean that it shoulr autodetect the lang from the written text?

@cmyr
Copy link
Member

cmyr commented Sep 3, 2019

I would expect that when you're writing in a different language you switch input methods to something for that language, and then your spellchecker picks up the locale change and switches dictionaries.

You could try and get fancier than this, but I think it covers like 99% of use cases?

@LiHRaM
Copy link
Contributor

LiHRaM commented Sep 3, 2019

Personally I never use US/UK/etc input methods for any English writing, as the English alphabet is a subset of the ones I use. I wouldn't be surprised if most people who write in a non-English language which uses the Latin alphabet do the same, which would cause some friction.

@cmyr
Copy link
Member

cmyr commented Sep 5, 2019

@LiHRaM How does this work for you, with regard to spellcheck, currently?

@LiHRaM
Copy link
Contributor

LiHRaM commented Sep 5, 2019

On Windows English is the default spellchecking language currently for Office / MS products such as Mail and Calendar and the browser. I'm not sure if this is because I have English as the display language and different keyboards assigned as input methods though. 🤷‍♂
I typically change it if auto-correct is enabled, otherwise I don't mind. But changing the spellcheck language is definitely something I would like to see in a plugin.

@Cogitri
Copy link
Member Author

Cogitri commented Sep 5, 2019

I'll provide a screenshot later of how Gedit does it, but they basically have right click -> languages and there you can check one of the available languages it checks for then. This is in line with about every other program I've used as of now, switching the input method is both inconvenient and also annoying since symbols usually aren't the same as with the user's native input method.

@HactarCE
Copy link

HactarCE commented Oct 7, 2019

Sublime uses the term "dictionary" for spellcheck localization.

@Cogitri
Copy link
Member Author

Cogitri commented Oct 7, 2019

Sounds good. I guess we could basically duplicate the languages (as in syntax) RPC stuff and just bend it to to dictionary

@HactarCE
Copy link

HactarCE commented Oct 8, 2019

Would this be something good for a beginner to do? I'd like to help, but all the low-hanging fruit has been completed.

@Cogitri
Copy link
Member Author

Cogitri commented Oct 8, 2019

Hmmm..not sure if it is. For this you'd need to:

  1. Pass all text to a plugin (could look at how the syntect plugin does that)

1a) Maybe offer some customisability (e.g. only send commented out strings to the spellchecker, I find that really handy since I don't need spellchecking for my code)

  1. Pass the text to some spellchecking library (IMHO enchant2 would be best and also has a Rust crate). You might have to format the text a bit before being able to dump it on the spellchecking lib (e.g. split it into words).

  2. Convert the results of the spellchecking lib into Xi annotations which are then sent to the frontend to display typos.

I guess offering suggestions as to what would be the correct way to write this might be a bit far fetched for now.

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

No branches or pull requests

4 participants