0 ? implode('/', $sel) : null; $list_langs = array(); $options = array(); foreach ($langs as $k => $v) { $list_langs[] = sprintf('%s', $page != null ? implode('/', array($k, $page)) : $k, $k == $locale ? ' class="sel"' : '', $v); $options[] = sprintf('', $k, $k == $locale ? ' selected="selected"' : '', $v); } // prevent 404 error on /{$locale}/ with missing translation function locale_path($path) { $pathtofile = "/home/projects/mageia/public_html"; $loc = $_SERVER['REQUEST_URI']; $filename = "$pathtofile$loc$path"; $url = "/en/$path"; if (file_exists($filename)) { $url = "$loc$path"; } return $url; } // global nav $nav_list = array( "/{$locale}/" => 'Mageia', /* '/news' => 'News', '/downloads' => 'Downloads', '/comm' => 'Community', '/about' => 'About Us' */ "http://blog.mageia.org/{$locale}" => array( 'el' => 'Ιστολόγιο', 'en' => 'Blog', 'et' => 'Ajaveeb', 'tr' => 'Web Günlüğü', 'ru' => 'Блог' ), "/downloads/" => array( //"/{$locale}/downloads/" => array( 'de' => 'Beta1 herunterladen', 'en' => 'Download Beta1', 'fr' => 'Télécharger Beta1', ), '/wiki/' => array( 'en' => 'Wiki', 'ru' => 'Вики' ), 'http://forums.mageia.org/en/' => 'Forums', '/en/calendar/' => array( 'de' => 'Kalender', 'el' => 'Ημερολόγιο', 'en' => 'Calendar', 'es' => 'Calendario', 'et' => 'Kalender', 'fr' => 'Calendrier', 'pl' => 'Kalendarz', 'pt' => 'Calendário', 'tr' => 'Takvim', 'ro' => 'Calendar', 'ru' => 'Календарь' ), /* "/{$locale}/faq/" => array( //locale_path('faq') => array( 'en' => 'FAQ', 'es' => 'Preguntas Frecuentes', 'et' => 'KKK', 'tr' => 'S.S.S.', 'ro' => 'Întrebări frecvente' ), */ // /* "http://mageia.org/wiki/doku.php?id=press" => array( 'de' => 'Presse', 'el' => 'Τύπος', 'en' => 'Press', 'es' => 'Prensa', 'et' => 'Ajakirjandus', 'fr' => 'Presse', 'pl' => 'Prasa o nas ', 'ro' => 'Presă', 'ru' => 'Пресса', 'tr' => 'Basın' ), */ '/en/about/' => array( 'en' => 'About', 'fr' => 'À propos' ), "/{$locale}/donate/" => array( //locale_path('donate') => array( //"http://www.mageia.org/en/donate//{$locale}/" => array( 'de' => 'Spenden', 'el' => 'Δωρεές', 'en' => 'Donations', 'es' => 'Donaciones', 'et' => 'Annetused', 'fr' => 'Dons', 'pl' => 'Dotacje', 'pt' => 'Doações', 'tr' => 'Bağışlar', 'ro' => 'Donații', 'ru' => 'Пожертвования' ), /* "/{$locale}/about/values" => array( //locale_path('about/values') => array( 'de' => 'Werte', 'el' => 'Αξίες', 'en' => 'Values', 'es' => 'Valores', 'et' => 'Väärtused', 'fr' => 'Valeurs', 'pl' => 'Wartości', 'pt' => 'Valores', 'tr' => 'Değerler', 'ro' => 'Valori', 'ru' => 'Цели' ), "/{$locale}/about/code-of-conduct" => array( //locale_path('about/code-of-conduct') => array( 'de' => 'Verhaltenskodex', 'el' => 'Κώδικας συμπεριφοράς', 'en' => 'Code of Conduct', 'es' => 'Código de Conducta', 'et' => 'Käitumisjuhised', 'fr' => 'Code de conduite', 'pl' => 'Kodeks postępowania', 'pt' => 'Código de Conduta', 'tr' => 'Temel İlkeler', 'ro' => 'Codul de conduită', 'ru' => 'Кодекс поведения' ), */ //*/ ); $list_menu = array(); foreach ($nav_list as $k => $v) { if (is_array($v)) $title = array_key_exists($locale, $v) ? $v[$locale] : $v['en']; else $title = $v; $accessKey = null; if ($title == 'Mageia') $accessKey = ' accesskey="1"'; $list_menu[] = sprintf('%s', $k, $k == $sru ? ' class="sel"' : '', $accessKey, $title); } echo sprintf(' H; /* echo sprintf('

%s

', implode(' | ', $list_langs)); */