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; } $blog_link = 'http://blog.mageia.org/'; if (in_array($locale, array('de', 'el', 'en', 'es', 'fr', 'it', 'nl', 'pl', 'pt', 'ro', 'ru', 'tr'))) $blog_link .= $locale . '/'; $forums_link = 'http://forums.mageia.org/'; // TODO pt, zh-tw, el if (in_array($locale, array('fr', 'de', 'es', 'pt-br'))) $forums_link .= $locale . '/'; // global nav $nav_list = array( "/{$locale}/" => 'Mageia', $blog_link => array( 'el' => 'Ιστολόγιο', 'en' => 'Blog', 'et' => 'Ajaveeb', //'fr' => 'Actus', 'pt' => 'Blogue', 'pt-br' => 'Blog', 'tr' => 'Web Günlüğü', 'ru' => 'Блог' ), //"/downloads/" => array( "/{$locale}/downloads/" => array( 'de' => 'Herunterladen', 'el' => 'Λήψεις', 'en' => 'Downloads', 'es' => 'Descargas', 'et' => 'Allalaadimine', 'fr' => 'Téléchargements', 'it' => 'Scarica', 'pt' => 'Transferências', 'pt-br' => 'Downloads', 'ro' => 'Descărcați', 'ru' => 'Загрузить', 'zh-tw' => '下載' ), '/support/' => array( 'de' => 'Unterstützung', 'el' => 'Υποστήριξη', 'en' => 'Support', 'es' => 'Soporte', 'fr' => 'Assistance', 'it' => 'Supporto', 'pt' => 'Suporte', 'pt-br' => 'Suporte', 'ro' => 'Suport' ), /* '/community/' => array( 'en' => 'Community', 'fr' => 'Communauté' ), */ $forums_link => array( 'el' => 'Φόρουμ', 'en' => 'Forum', 'es' => 'Foro', 'pt' => 'Fórum', 'pt-br' => 'Forum' ), '/contribute/' => array( 'de' => 'Mitwirken', 'el' => 'Συνεισφέρετε', 'en' => 'Contribute', 'es' => 'Contribuir', 'fr' => 'Contribuer', 'it' => 'Contribuire', 'pt' => 'Contribuir', 'pt-br' => 'Contribuir', 'ro' => 'Contribuiți' ), '/wiki/' => 'Wiki', /* '/en/calendar/' => array( 'de' => 'Kalender', 'el' => 'Ημερολόγιο', 'en' => 'Calendar', 'es' => 'Calendario', 'et' => 'Kalender', 'fr' => 'Calendrier', 'pl' => 'Kalendarz', 'pt' => 'Calendário', 'tr' => 'Takvim', 'ro' => 'Calendar', 'ru' => 'Календарь' ), */ /* "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' ), */ "/{$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', 'it' => 'Donazioni', 'pl' => 'Dotacje', 'pt' => 'Doações', 'pt-br' => 'Doações', 'tr' => 'Bağışlar', 'ro' => 'Donații', 'ru' => 'Пожертвования' ), '/en/about/' => array( 'de' => 'Über', 'el' => 'Σχετικά', 'en' => 'About', 'es' => 'Acerca de', 'fr' => 'À propos', 'it' => 'A proposito di', 'pt' => 'Acerca', 'pt-br' => 'Acerca', 'ro' => 'Despre noi' ), ); $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); } $hsnav = sprintf('
H; //$hsnav .= sprintf(' ', implode(' | ', $list_menu)); if (!defined('HLANG')) echo $hsnav; /* echo sprintf('%s
', implode(' | ', $list_langs)); */