Ignore:
Timestamp:
Nov 20, 2007, 10:37:05 PM (17 years ago)
Author:
vdigital
Message:

Czech language flag
Corrective: remove unneeded load_language() calls.

Location:
trunk/plugins/language_switch
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/language_switch/language_switch.inc.php

    r2162 r2164  
    2828  global $user, $template, $conf, $lang;
    2929  if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
     30  $same = $user['language'];
    3031  if ( isset( $_GET['lang']) )
    3132  {
     
    5758    $user['language'] = $_COOKIE['pwg_lang_switch'];
    5859  }
    59 
    60   load_language('common.lang', '', $user['language']);
    61   load_language('local.lang', '', $user['language']);
    62   if (defined('IN_ADMIN') and IN_ADMIN)
     60// Reload language only if it isn't the same one
     61  if ( $same !== $user['language'])
    6362  {
    64     load_language('admin.lang', '', $user['language']);
     63    load_language('common.lang', '', $user['language']);
     64    load_language('local.lang', '', $user['language']);
     65    if (defined('IN_ADMIN') and IN_ADMIN)
     66    {
     67      load_language('admin.lang', '', $user['language']);
     68    }
    6569  }
    6670}
Note: See TracChangeset for help on using the changeset viewer.