Need help with testing `spell-check` support for multiple dictionaries, OS X, and non-en-US locales


#1

So, my current obsession is working on Atom’s spell-check module to support some features that I use pretty heavily while writing novels. I think I have a working solution, but I need help because I don’t have access to a few things:

In specific, what I’ve done:

  • Added configuration settings to allow for multiple locales (en-US, de-DE).
  • Added support for a settable known word list, which lets you add known words. This uses RegExp so it’s pretty open.
  • Have it guess at the locale of the current user.
  • Added an infrastructure (via provides) that allows for other dictionary packages to contribute to spelling. I actually have an example of that for a project-specific dictionary which works pretty decently for me (put the words in language.json and have it picked up for only files in that project).
  • Added the support for adding words to various dictionaries.

Related spell-check issues:

What I need help with:

  1. I don’t use OS X, so I don’t know if dictionary lookup works or how to install other dictionaries.
  2. I have en-US as my default locale, I want to know if this correctly identifies the default locale for Linux, WIndows, and OS X users who are not en-US.
  3. Does it actually work? :stuck_out_tongue:

My work is currently on GitHub at https://github.com/dmoonfire/spell-check Installing seems to be pretty simple, clone the repository, apm rebuild, and apm link. Because it is a built-in package, I can’t really set it up on the apm repository at this point.

Any help would be great. I’m looking to finish this specific project so I can move on to the next one (Linter support probably).


#2

You could publish it as spell-check-plus for people to more easily check it out. You’d have to remind them in the README or whatever to disable the built-in spell-check. This is how autocomplete-plus started :grinning:

I’d be happy to try it out on OS X, though I am just an en-US user :dizzy_face:

Does that help?


#3

Well, I’ve come to the conclusion that you hate me. I had everything nice and stable but switching packages broke everything. :slight_smile: Oh well, had to learn those things anyway.

Okay, I think I got it. I created two packages and uploaded them to atom.io;


#4

“Hate” is such a strong word :stuck_out_tongue_winking_eye:

Glad you got things worked out. I’ll take a look at it as I have the chance!


#5

I know hate is a strong word.

I never had to use HTTPS for GitHub repos, but apm publish wasn’t working without it. Plus when I changed the package from spell-check to spell-check-test, everything broke so I had to change all the hard-coded constants to reflect the new package, including keybindings and LESS rules. Plus I didn’t know all of the apm publish rules and it took me a few hours to figure out why apm rebuild refused to build the gyp stuff (still not sure, but upgrading to 1.4.1 seemed to have fixed that).

Once I can verify things work and it is accepted (I hope), then I’ll squish all the commits to hide my mistakes fumbling through all that. :slight_smile:


#6

Have you had a chance to check it out?


#7

I’ve installed it in preparation for writing a blog post that I hope to be able to get to this afternoon. I think that will give a decent test to it rather than my typical fooling around with Atom to test various things :laughing:

Also, a feature was just added to the normal spell-check package to toggle it on and off:

You may want to merge that into your package too.


#8

Will do. Thank you for telling me about it.

I was planning on adding that to spell-check-project to let you control it at the project level, but having a general would make more sense for most people. :slight_smile:


#9

By the way, I have been using the spell-check-test package for the last six days and have had no issues. Everything seems to work exactly as I would expect.


#10

Awesome! When I get this commission finished up, I’ll see about fixing the various things I’ve missed (specs, a status page, working on startup performance) and then submit a PR.

Hopefully someone will help with the native language at some point, but that didn’t work previously, so I don’t think it would be a stopping point.

Thank you very much for your help.


#11

For those who are following this, I submitted the PR today. As soon as it is accepted/rejected, I’ll start on the next round which is probably getting spell-check to work with linter.


#12

I just found this, and it works well on Mac, finally letting me spell-checking in British English :slight_smile:

I had to add ‘text.md’ to the list of things to check – to add this to the existing list I had to go find them in package.json, as the default list can’t be copied out of the box it’s in in config, and is too long to see.

I wonder if it would make sense to just spell-check all of ‘text’ (of course, some grammar might be abusing what it puts in there).

But these were issues with the existing spell checker!


#13

Awesome news, always good to have confirmation. Did it pick up your British English without you changing the locale configuration?

I know where to add text.md, but it was out of scope for this item. Once it gets done, I might be able to submit a PR to add it. But, including all “text” doesn’t always work since almost every source code file is also considered “text” if it doesn’t have an assigned grammar.

Thank you.


#14

Nope, I did have to type “en-GB” manually. I have got ‘British English’ selected in control panel, and Apple’s apps use that setting.

I’m happy to have a look at the code, if there is any obvious part you would like me to try looking at / poking.


#15

Bummer, but there is something you can do. I tried to fake it with navigator.language but that might not work. If you could, please give me the output of the developer’s console when you do the following actions:

  1. Open up the developer pane.
  2. Have at least one buffer open to a text file.
  3. Have your Locales set to en-GB.
  4. Clear your developer console.
  5. Clear the Locales. This should trigger a reload and a bunch of text, give that to me, please.
  6. Clear the developer console again.
  7. Paste en-GB into the Locales. That should trigger another set, just as a baseline.

And then post both outputs here? I don’t need the expansion of the details, I’m mainly looking for either the text or a screenshot of the contents.

Thank you.


#16

Clear the console:

spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true [] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "English", paths: Array[0]} system-checker.coffee:72 spell-check:english OS X API

This might be interesting (might not), this is me typing en-gb, you can see each character appearing in turn (last 4 last, obviously, is the output for just en-gb.

spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true ["e"] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "e", paths: Array[0]} system-checker.coffee:89 spell-check:e Can't load e: Cannot find dictionary for e. spell-check-manager.coffee:269 spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true ["en"] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "en", paths: Array[0]} system-checker.coffee:72 spell-check:en OS X API spell-check-manager.coffee:269 spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true ["en-"] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "en-", paths: Array[0]} system-checker.coffee:72 spell-check:en- OS X API spell-check-manager.coffee:269 spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true ["en-G"] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "en-G", paths: Array[0]} system-checker.coffee:72 spell-check:en-g OS X API spell-check-manager.coffee:269 spell-check-test: unloading locales spell-check-manager.coffee:234 spell-check-test: loading locales true ["en-GB"] spell-check-manager.coffee:15 spell-check-test: addSpellChecker: SystemChecker {locale: "en-GB", paths: Array[0]} system-checker.coffee:72 spell-check:en-gb OS X API


#17

Well, that’s annoying. On Linux, navigator.language gives me en-US but on OS X, it says “English”.

I tried a different approach for figuring out the language for 0.74.0, could you try that? Thank you.


#18

The good news is, once I installed the package, everything worked fine, I’m now getting British English (en_GB to be exact) picked up correctly!

The (slightly) bad news is, the package wouldn’t update properly, due to something weird in spellchecker. I submitted an issue here, and it installed fine using apm on the command line.


#19

Yeah, I bumped the spellchecker to the latest version which matches what is checked into the spell-check package itself. Though, I found if you ignore the error, quit Atom, and then come back in, everything seems to be working. Go figure.

Thank you for submitting. I’ll update the PR with the new lookup code for languages since it works for my machines (Linux and Windows) and now yours. :slight_smile: Thank you!


#20

While you are deep inside spell checking, I thought I might make some other suggestions :slight_smile:
While spellchecking latex, pplain text has the scope text.tex.latex, while latex commands (which should not be spellchecked) have the two scopes text.tex.latex and support.function.general.tex.

Therefore what (I think) want to be able to do is say to spellcheck text.tex.latex, and NOT spellcheck support.function.general.tex, and have the nots always override the spellcheck.

I’m not sure if that is a reasonable request? Or perhaps should the ‘latex’ package provide a scope for plain text which is not applied to latex commands