aboutsummaryrefslogtreecommitdiffstats
path: root/langs.php
blob: b619ebf98d54efaaac0b0c81168e5b1f932c09b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
*/

// languages for home
$langs = array(
    'de' => 'Deutsch',
    'el' => 'Ελληνικά',
    'en' => 'English',
    'es' => 'Español',
    'et' => 'Eesti',
    'fi' => 'Suomeksi',
    'fr' => 'Français',
    'it' => 'Italiano',
    'lv' => 'Latviešu',
    'nb' => 'Bokmål',
    'nl' => 'Nederlands',
    'pl' => 'Polski',
    'pt-br' => 'Português do Brasil',
    'ru' => 'Русский',
    'tr' => 'Türkçe',
    'sl' => 'Slovenščina',
    'zh-cn' => '简体中文'
);

$sru = trim($_SERVER['REQUEST_URI']);
$sel = explode('/', $sru);
array_shift($sel);
$locale = array_shift($sel);
$page   = count($sel) > 0 ? implode('/', $sel) : null;

$list_langs = array();
foreach ($langs as $k => $v)
    $list_langs[] = sprintf('<a href="/%s"%s>%s</a>',
        $page != null ? implode('/', array($k, $page)) : $k,
        $k == $locale ? ' class="sel"' : '',
        $v);

// global nav
$nav_list = array(
    "/{$locale}/" => 'Mageia',
    "http://blog.mageia.org/{$locale}" => 'Blog',
    '/wiki' => 'Wiki &ndash; Join us!',
    "/{$locale}/faq/" => 'FAQ',
    "/{$locale}/#contact" => 'IRC, mailing-lists',
    "http://donate.mageia.org/{$locale}/" => 'Donations',
    "http://mageia.org/wiki/doku.php?id=press" => 'Press',
    "/{$locale}/about/values/" => 'Values'
);

$list_menu = array();
foreach ($nav_list as $k => $v)
    $list_menu[] = sprintf('<a href="%s"%s>%s</a>',
        $k,
        $k == $sru ? ' class="sel"' : '',
        $v);

echo sprintf('<div class="nav"><p class="loc">%s</p></div>', implode(' | ', $list_menu));

echo sprintf('<p class="loc">%s</p>', implode(' | ', $list_langs));