aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/languages.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/languages.php')
-rw-r--r--engine/lib/languages.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 94956a3ca..c765bf116 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -81,14 +81,23 @@
function load_translations($event, $object_type, $object) {
global $CONFIG;
- if ($handle = opendir($CONFIG->path . "languages/")) {
- while ($language = readdir($handle)) {
- if (!in_array($language,array('.','..','.svn','CVS')) && !is_dir($CONFIG->path . "/languages/" . $language)) {
- include($CONFIG->path . "languages/" . $language);
- }
+ register_translations($CONFIG->path . "languages/");
+
+ }
+
+ /**
+ * When given a full path, finds translation files and loads them
+ *
+ * @param string $path Full path
+ */
+ function register_translations($path) {
+ if ($handle = opendir($path)) {
+ while ($language = readdir($handle)) {
+ if (!in_array($language,array('.','..','.svn','CVS')) && !is_dir($path . $language)) {
+ @include($path . $language);
}
}
-
+ }
}
register_event_handler("init","system","load_translations");