} } } if (is_array($langs)) { arsort($langs, SORT_NUMERIC); foreach ($langs as $lang => $value) { $thelangs[] = $lang; } } // $session->langs=$thelangs; // $session->save(); self::$_preferred = $thelangs; } } public static function Localize($name, $identifier) { $locale = Localization::Get($name); for ($i = 0; $i < count(self::$_preferred); $i++) { $lang = self::$_preferred[$i]; if ($locale->{$identifier}->{$lang}) { return $locale->{$identifier}->{$lang}; } } } } function localize($name, $identifier) { return Localization::Localize($name, $identifier); } Localization::ParsePreferred();