How to set the spell checking language in CKEditor as used in mojoPortal

mojoPortal uses either CKEditor or TinyMCE as the default HTML editor. We tend to use CKEditor.

CKEditor toolbars in mojoPortal

The default configuration is American English. To change this in such a way that mojoPortal upgrades don't revert it back again, first configure the site to use a custom configuration file for CKEditor. Do this by first copying the default configuration file, found here: /ClientScript/ckeditor-mojoconfig.js, to create a new version (either in the same folder or anywhere else; any new file will not be overwritten in mojoPortal upgrades). Then add this setting to user.config:

<add key="CKEditor:ConfigPath" value="~/ckeditor-mycustomconfig.js"/> (this example presumes you have out the config file into the site root folder).

Then touch web.config to reload the settings.

Now you can edit the settings in the new file, to change the language (also to customize the toolbars etc, but that's another story).

To make the SCAYT (spell check as you type) function use British English, add this line into the main body of settings:

config.scayt_sLang = 'en_GB';

And to make the "Check Spelling" tool use British English by default, set this:

config.wsc_lang = 'en_GB';

Incidentally, since SCAYT often causes the editor to behave badly, I like to switch it off by default with this setting:

config.scayt_autoStartup = false;

Finally, beware of caching when changing these settings. I kept finding that making a change didn’t work, but I think the CKEditor javaScript was being cached in the browser.  In IE9, use F12 > Cache > Clear browser cache for this domain, plus I like to tick “Always refresh from server” to make sure.

Comments

Find out more