Changeset 4817 in subversion
- Timestamp:
- May 30, 2011 1:08:47 PM (2 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 4 edited
-
include/rcube_spellchecker.php (modified) (2 diffs)
-
js/app.js (modified) (3 diffs)
-
js/googiespell.js (modified) (2 diffs)
-
steps/mail/sendmail.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_spellchecker.php
r4815 r4817 53 53 $this->rc = rcmail::get_instance(); 54 54 $this->engine = $this->rc->config->get('spellcheck_engine', 'googie'); 55 $this->lang = $lang ;55 $this->lang = $lang ? $lang : 'en'; 56 56 57 57 if ($this->engine == 'pspell' && !extension_loaded('pspell')) { … … 156 156 157 157 $out .= '</spellresult>'; 158 159 return $out; 160 } 161 162 163 /** 164 * Returns checking result (mispelled words with suggestions) 165 * 166 * @return array Spellchecking result. An array indexed by word. 167 */ 168 function get() 169 { 170 $result = array(); 171 172 foreach ($this->matches as $item) { 173 if ($this->engine == 'pspell') { 174 $word = $item[0]; 175 } 176 else { 177 $word = mb_substr($this->content, $item[1], $item[2], RCMAIL_CHARSET); 178 } 179 $result[$word] = is_array($item[4]) ? implode("\t", $item[4]) : $item[4]; 180 } 158 181 159 182 return $out; -
trunk/roundcubemail/program/js/app.js
r4793 r4817 891 891 892 892 // all checks passed, send message 893 var form = this.gui_objects.messageform, 893 var lang = this.spellcheck_lang(), 894 form = this.gui_objects.messageform, 894 895 msgid = this.set_busy(true, 'sendingmessage'); 895 896 … … 897 898 form._draft.value = ''; 898 899 form.action = this.add_url(form.action, '_unlock', msgid); 900 form.action = this.add_url(form.action, '_lang', lang); 899 901 form.submit(); 900 902 … … 3003 3005 this.spellcheck_ready = (s == 'ready' || s == 'no_error_found'); 3004 3006 this.enable_command('spellcheck', this.spellcheck_ready); 3007 }; 3008 3009 // get selected language 3010 this.spellcheck_lang = function() 3011 { 3012 var ed; 3013 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody)) && ed.plugins.spellchecker) { 3014 return ed.plugins.spellchecker.selectedLang; 3015 } 3016 else if (this.env.spellcheck) { 3017 return GOOGIE_CUR_LANG; 3018 } 3005 3019 }; 3006 3020 -
trunk/roundcubemail/program/js/googiespell.js
r4477 r4817 11 11 */ 12 12 13 var SPELL_CUR_LANG = null;14 varGOOGIE_DEFAULT_LANG = 'en';13 var GOOGIE_CUR_LANG, 14 GOOGIE_DEFAULT_LANG = 'en'; 15 15 16 16 function GoogieSpell(img_dir, server_url) { … … 261 261 } else { 262 262 if (!ref.custom_no_spelling_error) 263 ref.flashNoSpellingErrorState();264 else265 ref.custom_no_spelling_error(ref);263 ref.flashNoSpellingErrorState(); 264 else 265 ref.custom_no_spelling_error(ref); 266 266 } 267 267 ref.removeIndicator(); -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r4816 r4817 414 414 && empty($_SESSION['compose']['spell_checked']) 415 415 ) { 416 $spellchecker = new rcube_spellchecker( );416 $spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC)); 417 417 $spell_result = $spellchecker->check($message_body, $isHtml); 418 418
Note: See TracChangeset
for help on using the changeset viewer.
