summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_spellcheck_enchant.php
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/lib/Roundcube/rcube_spellcheck_enchant.php
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/lib/Roundcube/rcube_spellcheck_enchant.php')
-rw-r--r--program/lib/Roundcube/rcube_spellcheck_enchant.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_spellcheck_enchant.php b/program/lib/Roundcube/rcube_spellcheck_enchant.php
index a22251e00..14d6fff46 100644
--- a/program/lib/Roundcube/rcube_spellcheck_enchant.php
+++ b/program/lib/Roundcube/rcube_spellcheck_enchant.php
@@ -31,6 +31,24 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
private $matches = array();
/**
+ * Return a list of languages supported by this backend
+ *
+ * @see rcube_spellcheck_engine::languages()
+ */
+ function languages()
+ {
+ $this->init();
+
+ $langs = array();
+ $dicts = enchant_broker_list_dicts($this->enchant_broker);
+ foreach ($dicts as $dict) {
+ $langs[] = preg_replace('/-.*$/', '', $dict['lang_tag']);
+ }
+
+ return array_unique($langs);
+ }
+
+ /**
* Initializes Enchant dictionary
*/
private function init()