menu TechnoSparks
keyboard_arrow_up

03
Oct

2017

Fixing Atom's Spellcheck Feature

An assistant that would finally help you spell
Back to blog

English is not my native tongue. That single statement alone should be enough to justify any errors and my inabilities to sometimes use proper grammar, to pinpoint an accurate word for something I am trying to convey, or of course, spell accurately. πŸ˜…

Skip the fuss, to the solution

Whenever I feel doubt of my spelling when I am writing on paper, I would usually fire up Google and just spell the word for search. Then Google will fix the spelling for me and I will then be able to write down the correct spelling. This reliance on Google or internet unfortunately would make me really anxious if I am unable to spell in examinations or similar.

Surely, since I write a lot, I would prefer to have something that would help me type conveniently, and show me errors when I do it. Thanks to spell-checking, a piece of technology that have been living for quite a long while, I am able to do this without any problem in my browser. On Android, there is this universal spell checker that can be set in Settings. My life seems complete, but hold on...

The application that I use to manage my website, for some reason, doesn't have its spell checker working correctly. The application's name is Atom, which is a popular text editor if you haven't heard of it.

Yeah, despite my behaviour of wanting everything I use to serve me well, my laziness is actually greater. πŸ™ƒ So I have been living and content with a broken spell-checker for really long time, until recently, another part of my laziness starts to annoy me – it is the laziness to proofread for spelling errors!

So we have a clear winner and I decide to delve into the issue and find for a solution.

In search for .... a fixed bug??

My adventures on the internet mostly end up in results where people faced the same issue as mine, but presumably fixed by a new feature commit to the spell-check package.. You can see such a discussion on the internet by searching the issue, but here's one as an example and here's another as GitHub issue.

Basically the the patch should allow the package to use the host's regional settings and language, effectively making spell-check integrate better with the system, and uses the built-in US dictionary as a fallback.

Since this is an old discussion, and the patch has already been merged to master branch of the Atom editor, there must be something wrong missing somewhere. Many actually says that the issue has been resolved for them, but still a few have the issue persisted. Maybe the last few didn't get the core idea of this answer by the original patch's contributor.

Yes, that was what inspired me the method to fix it. 😁

The Solution

After careful investigation, it seemed like the true cause for my issue is that I am missing the appropriate dictionary files. To easily remedy this, you will need to install the relevant locale packages in your Linux distro.

We will be using British dictionary (en-GB) as an example for this solution. You will obviously want to download the locale that you prefer.

Go to this LibreOffice GitHub β€œdictionary” repository and navigate to the folder that may contain the dictionary you are searching for. In this case, navigate to folder en.

Download both β€œen_GB.aff” and β€œen_GB.dic”, then place them into a directory of choice. Personally I put them in /usr/share/dict

Open Atom and open Settings. β€œCTRL + ,” for shortcut.

Click on β€œPackages” on the left pane and search for β€œspell-check”, afterwards click on the package.

Under β€œLocales”, enter the locale code like the example written. Since we are using British English, then it is β€œen-GB”.

Under β€œLocale Paths”, enter the path to the directory that you have put your dictionary files in. In the example earlier, this would be /usr/share/dict

Give your Atom a restart, and everything should work completely fine now! Don't forget to check if you have added the scope that you want the spell-check to be active in.

Thank you for reading πŸ˜„

Published on:

Get notified of new posts

Comments