From 6b9d509b089f6f070f19eccf44ae76d9ce36e96a Mon Sep 17 00:00:00 2001 From: vdigital Date: Tue, 20 Nov 2007 21:37:05 +0000 Subject: [PATCH] Czech language flag Corrective: remove unneeded load_language() calls. git-svn-id: http://piwigo.org/svn/trunk@2164 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/language_switch/icons/cz_CZ.gif | Bin 0 -> 903 bytes plugins/language_switch/language_switch.inc.php | 14 +++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 plugins/language_switch/icons/cz_CZ.gif diff --git a/plugins/language_switch/icons/cz_CZ.gif b/plugins/language_switch/icons/cz_CZ.gif new file mode 100644 index 0000000000000000000000000000000000000000..89686c4174738c4d3d67548ad0e202064725190c GIT binary patch literal 903 zcmb`GPe>GT6vsb_#rB6L)Qkf&EB-lY z2`Lmw>@A@cQRpD-p}r9;rpY&Xj=>K;3D2 zP(un6|Dx+hOksJ{Du$=QMjt|(z}lyIubscmdX7B&G-4FpBI_`oL^w=p+C}Gl4?RU5*pkI z_5hn>Br@nJ?wjZWEk$CodOy|61i_JY7Prp)C|;|%3N&~{^%w9N9QR%9E*3gwPMo@O z=R*csEyf_U_lY#K!w4=ai{0zGq9_PcQY>x6ao+h%7W*zdR5xtbTlc zw7$@J;rrX^7dIc)dSf=t{^ipP>#2LGlkv6KTA}6V%rwex2vYrp literal 0 HcmV?d00001 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() ); }