aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/language_switch/language_switch.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/language_switch/language_switch.inc.php')
-rw-r--r--plugins/language_switch/language_switch.inc.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php
index 2a5c37dbc..11a4c4ddd 100644
--- a/plugins/language_switch/language_switch.inc.php
+++ b/plugins/language_switch/language_switch.inc.php
@@ -27,6 +27,7 @@ function language_switch()
{
global $user, $template, $conf, $lang;
if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+ $same = $user['language'];
if ( isset( $_GET['lang']) )
{
if ( !empty($_GET['lang'] ) and
@@ -56,12 +57,15 @@ function language_switch()
{
$user['language'] = $_COOKIE['pwg_lang_switch'];
}
-
- load_language('common.lang', '', $user['language']);
- load_language('local.lang', '', $user['language']);
- if (defined('IN_ADMIN') and IN_ADMIN)
+// Reload language only if it isn't the same one
+ if ( $same !== $user['language'])
{
- load_language('admin.lang', '', $user['language']);
+ load_language('common.lang', '', $user['language']);
+ load_language('local.lang', '', $user['language']);
+ if (defined('IN_ADMIN') and IN_ADMIN)
+ {
+ load_language('admin.lang', '', $user['language']);
+ }
}
}
//if ( isset( $_GET['lang']) ) { redirect( make_index_url() ); }