aboutsummaryrefslogtreecommitdiff
path: root/actions/login.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-01-08 11:42:44 -0500
committerCash Costello <cash.costello@gmail.com>2012-01-08 11:42:44 -0500
commite3d38a9e9905ea19b48f5413d5c5b371f1bd7316 (patch)
treeb944f95108f320c96ba76bb92257656d4b290971 /actions/login.php
parentd213db79744507ab6e601167d158f256764d785e (diff)
downloadelgg-e3d38a9e9905ea19b48f5413d5c5b371f1bd7316.tar.gz
elgg-e3d38a9e9905ea19b48f5413d5c5b371f1bd7316.tar.bz2
Fixes #4171 login success message is now i18n friendly
Diffstat (limited to 'actions/login.php')
-rw-r--r--actions/login.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/actions/login.php b/actions/login.php
index c717faadd..256e78acb 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -46,10 +46,21 @@ if (!$user) {
try {
login($user, $persistent);
+ // re-register at least the core language file for users with language other than site default
+ register_translations(dirname(dirname(__FILE__)) . "/languages/");
} catch (LoginException $e) {
register_error($e->getMessage());
forward(REFERER);
}
-system_message(elgg_echo('loginok'));
+// elgg_echo() caches the language and does not provide a way to change the language.
+// @todo we need to use the config object to store this so that the current language
+// can be changed. Refs #4171
+if ($user->language) {
+ $message = elgg_echo('loginok', array(), $user->language);
+} else {
+ $message = elgg_echo('loginok');
+}
+
+system_message($message);
forward($forward_url);