From ced34cb15e095836767971aa4d27b141fb1d7ec9 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 18 Oct 2014 08:47:54 -0400
Subject: [PATCH] Merge pull request #230 from bytesatwork-xx/master

---
 program/lib/Roundcube/rcube_spellcheck_enchant.php |   18 ++++++++++++++++++
 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 a22251e..14d6fff 100644
--- a/program/lib/Roundcube/rcube_spellcheck_enchant.php
+++ b/program/lib/Roundcube/rcube_spellcheck_enchant.php
@@ -31,6 +31,24 @@
     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()

--
Gitblit v1.9.1