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

Add spell-checking #1336

Merged
merged 12 commits into from
May 12, 2020
Merged

Add spell-checking #1336

merged 12 commits into from
May 12, 2020

Conversation

nautatva
Copy link
Contributor

@nautatva nautatva commented Apr 14, 2020

This closes #14 which was long due and was waiting for sindresorhus/electron-context-menu#11


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@alekksander
Copy link

this is great. any way to specify language, or use few? (seems not to be available from context menu, but perhaps when compiling?)

@sindresorhus
Copy link
Owner

@alekksander I think it will use the language of your system.

@alekksander
Copy link

@sindresorhus it does, so it's english, but i type in different language more frequently

@nautatva
Copy link
Contributor Author

With this commit, you can select custom spell checkers alongside system default. The option is kept in ConversationSet spell checker language.

Given the way API's are exposed in electron, Custom languages cannot be selected on MacOS as mentioned in the Note here.

@alekksander
Copy link

alekksander commented Apr 20, 2020

there is something i don't quite get. if i build now and run appimage has only pl checker (my system defaults for formats (time, units, currency and such)), but if i install system wide (from deb) and run, then caprine has only en-us in spellchecker (my system default language for everything else). is there a way to have both? i tried to fiddle with kde plasma localization, but despite different system settings caprine spellchecker settings doesn't change.

also this occurs when i deselect en-us from the menu (sorry for photo, this text is not selectable). afterwards en-us doesn't have a checkmark on it, but spellchecker is still working
Screenshot_20200420_150121

@nautatva
Copy link
Contributor Author

Please check now if the error still exists. Also, as we are using <key,Value>, used Maps to store languages to its ISO codes.

@alekksander
Copy link

i confirm it works without JS error now, but the issue with preferred language, or rather not being able to choose one is ofc still existing. is there a way to have multiple languages to choose from?

@nautatva
Copy link
Contributor Author

This indeed was the commit which should have worked (be it for multiple languages), doesn't the languages you have selected show up in spell-check? Does the spell-checker atleast change to show suggestions for one language (perhaps the first language)?

@alekksander
Copy link

alekksander commented Apr 24, 2020

spell checking works good for the language that is selected, and stops working when it's not selected. it all works fast and properly. the list of languages however is still not populated. perhaps someone else could try it out so we rule out my system specific configuration?

Screenshot_20200424_134510

edit:
found out that if i manually set language in ~/.config/Caprine/Preferences it works for any language from source/menu.ts. example:

{"spellcheck":{"dictionaries":["pl"],"dictionary":""}}

or

{"spellcheck":{"dictionaries":["it"],"dictionary":""}}

or

{"spellcheck":{"dictionaries":["de"],"dictionary":""}}

and so on…

@nautatva
Copy link
Contributor Author

Now user gets a complete list of languages and the end user can choose from this list. Check if this works @alekksander. @sindresorhus any comments on the PR?

@alekksander
Copy link

i couldn't as for more. works perfectly even with few languages selected. thank You for the interest and sorry i wasn't able to actually commit (no skills)

source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
source/menu.ts Outdated Show resolved Hide resolved
source/config.ts Outdated Show resolved Hide resolved
source/config.ts Show resolved Hide resolved
readme.md Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@nautatva
Copy link
Contributor Author

nautatva commented May 3, 2020

  • Specified JSON Schema
  • Newline at end of package.json
  • Updated readme

These should do.

@sindresorhus sindresorhus changed the title Spellcheck with electron-context-menu update! Add spell-checking May 5, 2020
source/spell-checker.ts Outdated Show resolved Hide resolved
source/spell-checker.ts Outdated Show resolved Hide resolved
source/spell-checker.ts Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@nautatva nautatva requested a review from sindresorhus May 11, 2020 14:06
@sindresorhus sindresorhus merged commit 1914dab into sindresorhus:master May 12, 2020
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

Successfully merging this pull request may close these issues.

Implement spell checking
3 participants