SpellChecker plugin

From Code::Blocks
Revision as of 00:07, 14 October 2010 by Danselmi (talk | contribs) (Created page with '=Introduction= A plugin to check the spelling of strings and comments. The spelling gets checked during typing. Additionally a thesaurus is provided. =Configuration= [[File:Co…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

A plugin to check the spelling of strings and comments. The spelling gets checked during typing. Additionally a thesaurus is provided.


Configuration

ConfigureSpellChecker.png

The meaning of the controls are:

Enable online spell checker

Enable or disable the spell checker.

Language

The language used for spell checking and the thesaurus is selected by choosing a dictionary. This can also be changed in the status bar.

Path settings, Dictionaries

The plugin is looking in this path for the dictionary files.

Path settings, Thesauri

The plugin is looking in this path for the files needed by the thesaurus.

Path settings, Bitmaps

(Optional) The plugin is looking in this path for the flags to show in the status bar.

Dictionaries

SpellChecker uses a library called hunspell. Hunspell is the spell checker of OpenOffice.org, Mozilla Firefox and other projects. Dictionaries available for those applications are compatible with this plugin.

Open Office provides a collection of dictionaries for several languages and dialects to download. The OOo 3.x extensions (*.oxt) are compressed archives which can be opened with your favourite archiver (for example 7-Zip or File Roller). Copy the .aff file and the .dic file to the directory configured in 'Path settings, Dictionaries' (see above).

Thesaurus files

The files for the thesaurus are also available from OOo, like the dictionaries. Copy the thesaurus files (th_*.dat and th_*.idx) to the directory configured in 'Path settings, Thesauri' (see above) and rename them to match the name of the dictionary but prepend "th_" and let the extension as is.

Example: If the dictionary files (for one language) are "en_GB.aff" and "en_GB.dic" the files used for the thesaurus are "th_en_GB.idx" and "th_en_GB.dat".

Bitmaps (flags)

The bitmap of the actually selected language is shown in the status bar. If no bitmap is found, the name of the language is shown. The bitmap must be a PNG image. Choose a flag from the "famfamfam_flag_icons.zip" and copy it to the directory configured in 'Path settings, Bitmaps' (see above) and rename it to match the name of the dictionary but let the extension png.

Example: If the dictionary files (for one language) are "en_GB.aff" and "en_GB.dic" the the bitmap is named "en_GB.png" .


Styles to check

Only text with specific styles gets checked (for example only comments and strings). Styles are automatically set by Scintilla (CodeBlocks editing component).

The file OnlineSpellChecking.xml contains a list with indices of the styles to check. The indices differ for different programming-languages so the file contains a list for every programming-language. To add styles, look for the name of the programming-language and the indices in the corresponding lexer_XY.xml file and add this information to the file OnlineSpellChecking.xml.