aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-25 21:08:38 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-25 21:08:38 +0000
commit28ec773d386ffb9a9c1e58efae92922160a4b3e8 (patch)
treeb5d3eb387ffb2987e8e846bde1107a0eb117d912 /engine
parentae30968be5fa0cac4a8de75fa1a826c3ebf33de0 (diff)
downloadelgg-28ec773d386ffb9a9c1e58efae92922160a4b3e8.tar.gz
elgg-28ec773d386ffb9a9c1e58efae92922160a4b3e8.tar.bz2
Closes #808: Removed register_translation from the wild, now called on boot so that it is always after configuration_init
git-svn-id: https://code.elgg.org/elgg/trunk@2952 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/languages.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 7aacf5ac5..14692eeb4 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -80,13 +80,12 @@
if ((empty($language)) && ($user) && ($user->language))
$language = $user->language;
- if ((empty($language)) && (isset($CONFIG->language)))
- $language = $CONFIG->language;
-
- if (!empty($language)) {
+ if ((!$language) && ($CONFIG->language))
+ $language = $CONFIG->language;
+
+ if ($language) {
return $language;
- }
-
+ }
return false;
}
@@ -129,7 +128,7 @@
// Get the current language based on site defaults and user preference
$current_language = get_current_language();
-
+
if (isset($CONFIG->debug) && $CONFIG->debug == true) error_log("Translations loaded from : $path");
if ($handle = opendir($path)) {
@@ -242,7 +241,15 @@
return false;
}
-
- register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");
-
+
+ /**
+ * Initialise and register language translations.
+ *
+ */
+ function languages_init()
+ {
+ register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/");
+ }
+
+ register_elgg_event_handler('boot','system','languages_init',11); // Load languages after config.
?> \ No newline at end of file