From c344b64f13e7aa3c87c423cc14e57536d28c40b6 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 18 Oct 2013 12:50:25 +0200 Subject: Get supported spell-check languages from the configured backend; replace suspended google spell service with our new service at spell.roundcube.net --- program/lib/Roundcube/rcube_spellcheck_enchant.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'program/lib/Roundcube/rcube_spellcheck_enchant.php') 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 @@ -30,6 +30,24 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine private $enchant_dictionary; 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 */ -- cgit v1.2.3