summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-10-16 19:12:24 +0000
committerthomascube <thomas@roundcube.net>2005-10-16 19:12:24 +0000
commit9fee0ed9af6bb1daa3af2ff7290f5589040b4821 (patch)
treecc2593236458fdf56896831ac4bdee79bc6fc68c /program/include/main.inc
parent69f71ba62d8e7d77c4877b47131836ea3f52f6ee (diff)
Fixed folder display; added Portuguese and Catalan
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc27
1 files changed, 27 insertions, 0 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 1c413bb80..5eabf755d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -423,6 +423,33 @@ function rcube_remote_response($js_code)
}
+// read directory program/localization/ and return a list of available languages
+function rcube_list_languages()
+ {
+ global $CONFIG, $INSTALL_PATH;
+ static $sa_languages = array();
+
+ if (!sizeof($sa_languages))
+ {
+ @include_once($INSTLL_PATH.'program/localization/index.inc');
+
+ if ($dh = @opendir($INSTLL_PATH.'program/localization'))
+ {
+ while (($name = readdir($dh)) !== false)
+ {
+ if ($name{0}=='.' || !is_dir($INSTLL_PATH.'program/localization/'.$name))
+ continue;
+
+ if ($label = $rcube_languages[$name])
+ $sa_languages[$name] = $label ? $label : $name;
+ }
+ closedir($dh);
+ }
+ }
+
+ return $sa_languages;
+ }
+
// ************** template parsing and gui functions **************