HOWTO make spellchecking in KDE applications function properly

From LinuxReviews
Jump to navigationJump to search
KDE Katie.png

All KDE Plasma applications has a built-in spellchecker which uses a back-end library called sonnet which in turn uses hunspell or the older aspell for actual spell checking. The default behavior of this spellchecker may not work at all or randomly claim some correctly spelled words are misspelled while claiming some correctly spelled words are spelled incorrect.

The cause and the fix[edit | edit source]

The cause of frustration is language "auto-detection" and it can be fixed by turning that "feature" off. Enter KDE's "System Settings" from the menu or by running systemsettings5. Select Regional Settings in the menu to the left. Select Spell Check and look closely at the Options in the middle of the spell-check settings.

The problematic setting which is enabled by default is [x] Enable autodetection of language. You absolutely have to disable this setting in order to use spell checking in KDE applications.

If you are writing a document in Danish and you have made sure that the spellchecker is set to da_DK and you misspell a few words which happen to be valid in Norwegian then this "automatic" detection "feature" (=bug) will happily conclude that your entire text is written in Norwegian and claim all the correctly spelled Danish words are misspelled. It does not matter that you've set the language to da_DK because the "intelligent" auto-detection knows better.

Why would they do this?[edit | edit source]

Since you are reading this page now you've probably ran into this bug and got frustrated. You are not alone, the KDE bug tracker has plenty of open bugs documenting many people's frustration with a seemingly useless and broken spell-checking feature in applications ranging from Kate to Kmail. This affects everything. The good news is, of course, that you can make the spell-checker work as expected by disabling the language "auto-detection" (=randomize) "feature".

So why would they do enable a buggy not-feature which breaks spellchecking across all KDE applications? That's a good question.

One last tip on missing dictionaries[edit | edit source]

KDE's spellchecker uses a framework called sonnet which simply acts as a middle-man for hunspell or the older aspell spellcheckers. The dictionaries for hunspell are typically packaged by distributions in separate packages named hunspell-$languagecode. You can see which are available on your platform with a command such as apt search hunspell- and dnf search hunspell-. You can simply install all the dictionaries with dnf -y install hunspell*