Jump to:

517 Posts in 247 Topics by 260 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » Setting the spell checking language

Forum for content editors and CMS users.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 5746 Views
  • Alex S
    Avatar
    Community Member
    30 Posts

    Setting the spell checking language Link to this post

    Hey,

    Does anyone know how to set the spell checking language for the back-end of the CMS? I looked at "jsparty" > "tiny_mce2" > "plugins" > "spellchecker" > "config.php" but this doesn't seem to specify a language.

    I changed "sapphire" > "_config.php" to include "i18n::set_locale('en_GB');" but the only language available for the spell checker is still "English (United States)".

    Any ideas?

    Alex

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: Setting the spell checking language Link to this post

    hello,
    had the same problem an did some research on it:
    the magic happens in CMSMain.php:

    $spellcheckLangs = Translatable::get_existing_content_languages();


    now, in case you want to set a specific language manually, you can do this through HtmlEditorConfig in _config.php like so (i.e. for german):

    HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', '+Deutsch=de');


    (the '+' will make it auto-selected)
    problem being, the code in CMSMain.php will overwrite what you did in _config.php, so you have to comment out the following line there:

    HtmlEditorConfig::get('cms')->setOption('spellchecker_languages', '+' . implode(',', $spellcheckSpec));


    hth

  • Platypus
    Avatar
    Community Member
    43 Posts

    Re: Setting the spell checking language Link to this post

    Thank you schellmax, is was looking for a working solution, this workaround helped me a lot

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Setting the spell checking language Link to this post

    This should be fixed in trunk now: http://open.silverstripe.com/changeset/81716

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: Setting the spell checking language Link to this post

    thanks, ingo!

    edit: just found there are still other options getting overridden in LeftAndMain.php
    i tried the following in my _config.php:

    HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');


    but it doesn't work, because of this in LeftAndMain.php:

    HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');


    commenting this line out once again does the trick, but...
    should i file a ticket for this?

    edit: there's even more... ticket created: http://open.silverstripe.com/ticket/4390

  • Alex S
    Avatar
    Community Member
    30 Posts

    Re: Setting the spell checking language Link to this post

    Hey,

    Thanks for the tip, that works nicely.

    Alex

  • AlexBeka
    Avatar
    Community Member
    21 Posts

    Re: Setting the spell checking language Link to this post

    thanks ingo for this fix;

    might be interesting for the german-language using of you:
    i had a problem with the suggested words and german umlauts ("deutsche Umlaute") and replaced therefore in GoogleSpell.php in function getSuggestions the line

    $sug = explode("\t", utf8_encode($this->_unhtmlentities($matches[0][4])));

    with

    $sug = explode("\t", $this->_unhtmlentities($matches[0][4]));

    see also a short german description of this issue there: http://blog.wordpress-deutschland.org/2008/09/08/tinymce-und-die-deutsche-rechtschreibpruefung.html

  • Joeri81
    Avatar
    Community Member
    4 Posts

    Re: Setting the spell checking language Link to this post

    I have the same problem: I am using Silverstripe 2.3.6. I want the spellchecker of TinyMCE to check Dutch spelling. Which code do I have to overwrite?
    I am a beginner in PHP so I need some strong directions . I tried the soluton above but it didn't work (I probably did something wrong).

    My showcase site is located here:
    http://www.vauxhallclub.nl/website/site

    5746 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.