summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-10-18 12:50:25 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-10-18 12:50:25 +0200
commitc344b64f13e7aa3c87c423cc14e57536d28c40b6 (patch)
treedc64f304fc4cb0082f45d2cb560259ec22acee47 /program/steps/mail
parent70c7df8faa5a9023a2773dc5a38932f1ad3a84aa (diff)
Get supported spell-check languages from the configured backend; replace suspended google spell service with our new service at spell.roundcube.net
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc27
1 files changed, 6 insertions, 21 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index dc2452506..166a58341 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -852,29 +852,14 @@ function rcmail_compose_body($attrib)
// Set language list
if (!empty($CONFIG['enable_spellcheck'])) {
- $engine = $RCMAIL->config->get('spellcheck_engine','googie');
+ $engine = new rcube_spellchecker();
$dictionary = (bool) $RCMAIL->config->get('spellcheck_dictionary');
- $spellcheck_langs = (array) $RCMAIL->config->get('spellcheck_languages',
- array('da'=>'Dansk', 'de'=>'Deutsch', 'en' => 'English', 'es'=>'Español',
- 'fr'=>'Français', 'it'=>'Italiano', 'nl'=>'Nederlands', 'pl'=>'Polski',
- 'pt'=>'Português', 'ru'=>'Русский', 'fi'=>'Suomi', 'sv'=>'Svenska'));
-
- // googie works only with two-letter codes
- if ($engine == 'googie') {
- $lang = strtolower(substr($_SESSION['language'], 0, 2));
-
- $spellcheck_langs_googie = array();
- foreach ($spellcheck_langs as $key => $name)
- $spellcheck_langs_googie[strtolower(substr($key,0,2))] = $name;
- $spellcheck_langs = $spellcheck_langs_googie;
- }
- else {
- $lang = $_SESSION['language'];
+ $spellcheck_langs = $engine->languages();
+ $lang = $_SESSION['language'];
- // if not found in the list, try with two-letter code
- if (!$spellcheck_langs[$lang])
- $lang = strtolower(substr($lang, 0, 2));
- }
+ // if not found in the list, try with two-letter code
+ if (!$spellcheck_langs[$lang])
+ $lang = strtolower(substr($lang, 0, 2));
if (!$spellcheck_langs[$lang])
$lang = 'en';