aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-26 18:06:40 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-26 18:06:40 +0000
commit963ab53fc2ad247ebbdcec2e4ad8c9064e2d2352 (patch)
tree689cbaab0cb7bad2056d0e70d5eb2972b33bcc25 /engine
parent583f7944dc3d9299cfd2ecfa2c02bb31946a4163 (diff)
downloadelgg-963ab53fc2ad247ebbdcec2e4ad8c9064e2d2352.tar.gz
elgg-963ab53fc2ad247ebbdcec2e4ad8c9064e2d2352.tar.bz2
Added get_installed_translations() to return an array of available translations together with native language translation of the text. Refs #98
git-svn-id: https://code.elgg.org/elgg/trunk@1154 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/languages.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 781fe2e6e..973309cb9 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -94,6 +94,21 @@
else
error_log("Missing translation path $path");
}
+
+ /**
+ * Return an array of installed translations as an associative array "two letter code" => "native language name".
+ */
+ function get_installed_translations()
+ {
+ global $CONFIG;
+
+ $installed = array();
+
+ foreach ($CONFIG->translations as $k => $v)
+ $installed[$k] = elgg_echo($k, $k);
+
+ return $installed;
+ }
register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");