Spellcheck for SilverStripe
PHP
Pull request Compare This branch is 38 commits ahead of tractorcow:master.
Latest commit 4032013 Dec 10, 2016 @dhensby dhensby Merge branch '1.0'
Permalink
Failed to load latest commit information.
.tx
_config
code
lang Update translations Aug 16, 2016
tests Merge branch '1.0' Dec 9, 2016
.editorconfig
.gitattributes
.scrutinizer.yml
.travis.yml
changelog.md
code-of-conduct.md Added standard code of conduct Nov 21, 2015
composer.json
license.md Updated license year Jan 5, 2016
readme.md

readme.md

Spellcheck for SilverStripe

Build Status

Improves spellcheck support for SilverStripe CMS, including an implementation for HunSpell.

Installation

Ensure that your server is setup with hunspell, and the necessary dictionaries for each language you wish to use.

Install the spellcheck module with composer, using composer require silverstripe/spellcheck:*, or downloading the module and extracting to the 'spellcheck' directory under your project root.

Configuration

Setup the locales you wish to check for using yaml. If you do not specify any, it will default to the current i18n default locale, and may not be appropriate if you have not configured dictionaries for some locales.

mysite/_config/config.yml

SpellController:
  locales:
    - en_NZ
    - fr_FR
    - de_DE

By default only users with the CMS_ACCESS_CMSMain permission may perform spellchecking. This permisson code can be altered (or at your own risk, removed) by configuring the SpellController.required_permission config.

SpellController:
  # Restrict to admin only
  required_permission: 'ADMIN'

Extending

Additional spell check services can be added by implementing the SpellProvider interface and setting this as the default provider using yaml.

mysite/_config/config.yml

---
Name: myspellcheckprovider
After: '#spellcheckprovider'
---
# Set the default provider to HunSpell
Injector:
  SpellProvider: MySpellProvider