Update to new SpellChecker js code
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Oct 2009 18:50:52 +0000 (12:50 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Oct 2009 18:50:52 +0000 (12:50 -0600)
framework/Ajax/lib/Horde/Ajax/Imple/SpellChecker.php

index 29ecfc6..ba6d1ba 100644 (file)
@@ -41,12 +41,14 @@ class Horde_Ajax_Imple_SpellChecker extends Horde_Ajax_Imple_Base
             $params['states'] = Horde_Serialize::serialize($params['states'], Horde_Serialize::JSON, Horde_Nls::getCharset());
         }
         if (empty($params['locales'])) {
+            $key_list = array_keys(Horde_Nls::$config['spelling']);
+            asort($key_list, SORT_LOCALE_STRING);
             $params['locales'] = array();
-            foreach (array_keys(Horde_Nls::$config['spelling']) as $lcode) {
-                $params['locales'][$lcode] = Horde_Nls::$config['languages'][$lcode];
+
+            foreach ($key_list as $lcode) {
+                $params['locales'][] = array('l' => Horde_Nls::$config['languages'][$lcode], 'v' => $lcode);
             }
         }
-        asort($params['locales'], SORT_LOCALE_STRING);
         $params['locales'] = Horde_Serialize::serialize($params['locales'], Horde_Serialize::JSON, Horde_Nls::getCharset());
 
         parent::__construct($params);