From ff76101d277661e90d1ab4fb7dbe1c4f7b958505 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Fri, 25 May 2012 15:14:44 +0000 Subject: merge changes from nav.mageia.org --- _nav/css/source.css | 10 +++++++++- _nav/html/index.php | 7 ++++++- _nav/langs/eo.lang | 37 +++++++++++++++++++++++++++++++++++++ _nav/langs/et.lang | 17 +++++++++++++++++ _nav/lib.php | 14 ++++++++++++++ 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 _nav/langs/eo.lang create mode 100644 _nav/langs/et.lang (limited to '_nav') diff --git a/_nav/css/source.css b/_nav/css/source.css index 01bb85483..f544a872f 100644 --- a/_nav/css/source.css +++ b/_nav/css/source.css @@ -1,5 +1,10 @@ /*! mageia.org nav CSS */ +/** + * TODO top nav must stay on top when scrolling (reduced or full) + * +*/ + #hmgn { margin: 0; padding: 0; } #mgnav { margin: 0; padding: 0; @@ -41,7 +46,7 @@ #nav a.mageia { width: 143px; - background: #fff url(/_nav/css/mageia-logo-nav.png) no-repeat 30px 10px; + background: #fff url(//nav.mageia.org/css/mageia-logo-nav.png) no-repeat 30px 10px; color: transparent; text-shadow: none; } @@ -49,8 +54,11 @@ .about #mgnav .about, .downloads #mgnav .downloads, .community #mgnav .community, +.blog #mgnav .community, +.mediawiki #mgnav .community, .support #mgnav .support, .contribute #mgnav .contribute, +.bugs-mageia-org #mgnav .contribute, .contrib #mgnav .contrib, .you #mgnav .you { diff --git a/_nav/html/index.php b/_nav/html/index.php index 31ba1d514..7297f84ec 100644 --- a/_nav/html/index.php +++ b/_nav/html/index.php @@ -9,6 +9,11 @@ $url = isset($_GET['u']) ? trim($_GET['u']) : null; /** html[lang] of the doc. */ $lang = isset($_GET['l']) ? trim($_GET['l']) : null; +if ($lang == 'undefined' || + $lang == '') { + + $lang = 'en'; +} /** body[class] of the doc. */ $body = isset($_GET['b']) ? trim($_GET['b']) : null; @@ -25,4 +30,4 @@ header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET'); header('Content-Type: text/html;charset=utf-8'); header(sprintf('Expires: %s', gmdate('r', strtotime('+1 day')))); -echo _mgnav_html($wrap, $lang); \ No newline at end of file +echo _mgnav_html($wrap, $lang); diff --git a/_nav/langs/eo.lang b/_nav/langs/eo.lang new file mode 100644 index 000000000..392d7cf73 --- /dev/null +++ b/_nav/langs/eo.lang @@ -0,0 +1,37 @@ +;About us +Pri ni + +;Downloads +Elŝutoj + +;Support +Subteno + +;Community +Komunumo + +;Contribute +Kontribui + +;You +Vi + +;Go to mageia.org site map. +Iri al la paĝarmapo de mageia.org. + +;Learn more about Mageia. +Scii pli pri Magejo. + +;Download Mageia ISO and updates. +Elŝuti ISO-dosierojn kaj ĝisdatigojn de Magejo. + +;Get support from Mageia community. +Trovi helpon en la Mageja komunumo. + +; + +;You too can build Mageia with us! +Vi povas helpi nin fari Magejon! + +;Your Mageia online account. +Via enreta Mageja konto. diff --git a/_nav/langs/et.lang b/_nav/langs/et.lang new file mode 100644 index 000000000..cacd951e8 --- /dev/null +++ b/_nav/langs/et.lang @@ -0,0 +1,17 @@ +;About us +Üldine teave + +;Downloads +Allalaadimine + +;Support +Toetus + +;Community +Kogukond + +;Contribute +Abistamine + +;You +Mina diff --git a/_nav/lib.php b/_nav/lib.php index b04484995..c86b42282 100644 --- a/_nav/lib.php +++ b/_nav/lib.php @@ -54,6 +54,8 @@ class l10n */ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = '//www.mageia.org') { + $lang = _lang_simple($lang); + l10n::load($lang); $tn = array( @@ -102,3 +104,15 @@ function _mgnav_style() { return ''; } + +/** + * Get the primary language subtag only.

+*/ +function _lang_simple($s = null) +{ + if (!is_null($s)) { + $s = explode('-', $s); + $s = strtolower($s[0]); + } + return $s; +} -- cgit v1.2.1