website view lib/lang.php @ rev 1144

Update ddg link
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 31 10:40:07 2012 +0100 (2012-10-31)
parents 93b466edbab4
children ea342b6a4ac7
line source
1 <?php
3 $addr = str_replace('.php', '', $_SERVER['REQUEST_URI']);
4 $addr = str_replace('index', '', $addr);
6 $addr = explode('/', $addr);
7 $cur = $addr[1];
8 $page = '';
9 if (isset($addr[2]))
10 $page = $addr[2];
11 if (isset($addr[3]))
12 $page = $addr[3];
15 $native = array ("bs"=>"Bosanski", "da"=>"Dansk", "de"=>"Deutsch", "en"=>"English", "es"=>"Español", "fr"=>"Français", "id"=>"Indonesian", "it"=>"Italiano", "pt"=>"Português", "ru"=>"Русский", "cn"=>"中文");
17 switch($page)
18 {
19 case "mailing-list":
20 $url = "/LANG/mailing-list.php";
21 $lang = "da de en es fr it pt ru";
22 break;
23 case "search":
24 $url = "/LANG/search.php";
25 $lang = "cn da de en es fr pt ru";
26 break;
27 case "about":
28 $url = "/LANG/about/";
29 $lang = "cn da de en es fr pt ru";
30 break;
31 case "artwork":
32 $url = "/LANG/artwork/";
33 $lang = "cn da de en es fr pt ru";
34 break;
35 case "events":
36 $url = "/LANG/about/events.php";
37 $lang = "fr";
38 break;
39 case "screenshots":
40 $url = "/LANG/artwork/screenshots.php";
41 $lang = "cn da de en fr pt ru";
42 break;
43 case "asso":
44 $url = "/LANG/asso/";
45 $lang = "en es fr pt";
46 break;
47 case "statutes":
48 $url = "/LANG/asso/statutes.php";
49 $lang = "en pt";
50 break;
51 case "devel":
52 $url = "/LANG/devel/";
53 $lang = "da de en es fr pt ru";
54 break;
55 case "forge":
56 $url = "/LANG/devel/forge.php";
57 $lang = "en fr pt ru";
58 break;
59 case "doc":
60 $url = "/LANG/doc/";
61 $lang = "cn en es fr it pt ru";
62 break;
63 case "get":
64 $url = "/LANG/get/";
65 $lang = "cn da de en es fr it pt ru";
66 break;
67 case "flavors":
68 $url = "/LANG/get/flavors.php";
69 $lang = "cn da de en fr pt ru";
70 break;
71 case "news":
72 $url = "/LANG/news/";
73 $lang = "de en es fr pt ru";
74 break;
75 case "2007":
76 $url = "/LANG/news/2007.php";
77 $lang = "en fr";
78 break;
79 case "2008":
80 $url = "/LANG/news/2008.php";
81 $lang = "en es fr pt";
82 break;
83 case "2009":
84 $url = "/LANG/news/2009.php";
85 $lang = "en es fr pt";
86 break;
87 case "2010":
88 $url = "/LANG/news/2010.php";
89 $lang = "en fr pt";
90 break;
91 case "packages":
92 $url = "/LANG/packages/";
93 $lang = "cn da de en es fr it pt ru";
94 break;
95 case "sponsor":
96 $url = "/LANG/sponsor/";
97 $lang = "en pt";
98 break;
99 default:
100 $url = "/LANG/";
101 $lang = "cn bs da de en es fr id it pt ru";
102 break;
103 }
105 echo "<!-- Languages -->\n<div id='lang'>\n" .
106 " <a href='/i18n.php'><img src='/images/locale.png' alt='i18n' /></a>\n";
108 foreach($native as $short=>$long)
109 {
110 if ($cur==$short)
111 echo " <strong>$long</strong>\n";
112 elseif (strpos($lang, $short) === false)
113 echo " $long\n";
114 else
115 echo ' <a href="'.str_replace('LANG', $short, $url).'">'.$long."</a>\n";
116 }
117 echo "</div>\n";
119 ?>