Gadgets/Rechtschreibpruefung


More general info about Gadgets

Setup

edit

To setup the gadget in new project (that supports Wikidata):

  1. Create a dictionary of common mistakes - with the same format as in de:Wikipedia:Helferlein/Rechtschreibprüfung/Wortliste
  2. Link to Wikidata - Link the new dictionary page to wikidata: d:Q15098221
  3. Add the source code
    • To turn it as a gadget that user can select in their preferences (requires sysop rights):
      1. create MediaWiki:Gadget-spellchecker.js with the following code:
        mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User%3A%D7%A2%D7%A8%D7%9F%2Fspellchecker.js&action=raw&ctype=text/javascript');
        
      2. create MediaWiki:Gadget-spellchecker with short description
      3. add it to MediaWiki:Gadgets-definition
    • To test it (if you aren't sysop):
      1. add the source code to your personal JS (Special:MyPage/common.js).
        mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User%3A%D7%A2%D7%A8%D7%9F%2Fspellchecker.js&action=raw&ctype=text/javascript');
        

Some word is highlighted as mistake, but it is in citation

edit

The script doesn't do spell-checking in citation tags: blockquote, q, cite. It also ignores any citation between „ and “. It is recommended to use citation tags within citation templates (use style attribute to control the styling).

Language variants

edit

In some languages there are different variants - and it is possible to use different dictionaries for different variants. Copy the code in User:ערן/spellchecker.js and replace langVariants with variants specification. For example:

var langVariants = {
        'VARIANT-NAME': 'VARIANT-CODE',
        'VARIANT-NAME2': 'VARIANT-CODE2'
}

And then create a subpage for the dictionary page with /VARIANT-CODE suffix. In any page the contains VARIANT-NAME in its text, the spellchecker will use this subpage instead of the default dictionary.

Example: if the dictionary is located in a page Wikipedia:Spell checker/dictionary, and the following langVariants are used

var langVariants = {
        'Britain': 'uk'
}

Then in any page the contains the word "Britain" the spell checker will use Wikipedia:Spell checker/dictionary/uk instead of Wikipedia:Spell checker/dictionary.

Spell-checking while editing

edit

The script checks spelling while reading or while editing in the VisualEditor. It is highly recommended to install also a native spell-checking within the browser - it has much larger dictionary of mistakes and it can treat language specific grammar rules. The following links give more details (browser specific):