$CHARS = Array('ru' => 'windows-1251', 'en' => 'windows-1251');
setcookie('LANGUAGE_ID', (empty($GLOBALS['_COOKIE']['LANGUAGE_ID']) && (empty($GLOBALS['_GET']['lang']) || empty($CHARS[$GLOBALS['_GET']['lang']])) ? $arLang["LANGUAGE_ID"] : (empty($GLOBALS['_GET']['lang']) ? $GLOBALS['_COOKIE']['LANGUAGE_ID'] : $GLOBALS['_GET']['lang'])), time() + 3600);
if (empty($GLOBALS['_COOKIE']['LANGUAGE_ID']) && (empty($GLOBALS['_GET']['lang']) || empty($CHARS[$GLOBALS['_GET']['lang']]))) { $GLOBALS['_COOKIE']['LANGUAGE_ID'] = $arLang["LANGUAGE_ID"];
} elseIf (!empty($GLOBALS['_GET']['lang']) && !empty($CHARS[$GLOBALS['_GET']['lang']])) { $GLOBALS['_COOKIE']['LANGUAGE_ID'] = $GLOBALS['_GET']['lang']; }
define("LANGUAGE_ID", $GLOBALS['_COOKIE']["LANGUAGE_ID"]);
define("LANG_CHARSET", $CHARS[LANGUAGE_ID]); |