Пример #1
0
 * @version    Subversion $Id: language.php 1433 2009-12-07 18:35:05Z benoitg $
 * @link       http://www.wifidog.org/
 */
/**
 * Load required files
 */
require_once 'classes/WifidogLocale.php';
if (!empty($_REQUEST['wifidog_language'])) {
    $session = Session::getObject();
    //echo "Setting to $_REQUEST[wifidog_language]<br/>";
    $AVAIL_LOCALE_ARRAY = LocaleList::getAvailableLanguageArray();
    /* Try to guess the lang */
    if (!empty($AVAIL_LOCALE_ARRAY[$_REQUEST['wifidog_language']])) {
        $session->set(SESS_LANGUAGE_VAR, $_REQUEST['wifidog_language']);
    } else {
        throw new Exception(htmlspecialchars($_REQUEST['wifidog_language']) . " is not a valid locale");
    }
}
$locale = WifidogLocale::getCurrentLocale();
WifidogLocale::setCurrentLocale($locale);
$locale_id = $locale->getId();
if (isset($smarty)) {
    $smarty->assign("lang_id", $locale_id);
}
/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */