static function initialize() { if (!isset($_COOKIE['lang'])) { self::$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); setcookie('lang', self::$language); } else { self::$language = $_COOKIE['lang']; } }
protected static function init() { if (!is_array(self::$language)) { $session = Application::getInstance('Session'); $language = isset($session->language) ? $session->language : self::DEFAULT_LANGUAGE; require_once getcwd() . '/application/language/' . $language . '.php'; self::$language = $language; } }
public static function Load() { $file = PREFIX . "/lang/" . LANG . ".php"; if (is_readable($file)) { require $file; } else { require PREFIX . "/lang/en.php"; } /* default system language */ self::$language = $lang; Debug::Log("Language '" . LANG . "', file : '" . $file) . "'"; }