aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2010-11-29 15:00:41 +0000
committerRomain d'Alverny <rda@mageia.org>2010-11-29 15:00:41 +0000
commit13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f (patch)
tree2eeec72912cddfe338a360bd0f7f313af64cb100 /index.php
parent977c8d761c014fb4ae36185c12ec9c827f0e122d (diff)
downloadwww-13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f.tar
www-13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f.tar.gz
www-13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f.tar.bz2
www-13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f.tar.xz
www-13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f.zip
new languages selector
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/index.php b/index.php
index e10f5d0be..9293c754f 100644
--- a/index.php
+++ b/index.php
@@ -3,10 +3,26 @@
*/
require_once 'langs.inc.php';
+
+if (isset($_GET['flang']))
+{
+ $lang = array_key_exists($_GET['flang'], $langs) ? $_GET['flang'] : 'en';
+ if (isset($_GET['furl']))
+ {
+ $url = substr_replace($_GET['furl'], $lang, 1, 2);
+ }
+ else
+ $url = '/' . $lang . '/';
+
+ header(sprintf('Location: %s', $url));
+ die;
+}
+
require_once 'localeDetection.class.php';
$locale = new ChooseLocale(array_keys($langs));
$locale->setDefaultLocale('en');
-header(sprintf('Location: /%s/', $locale->getCompatibleLocale())); \ No newline at end of file
+header(sprintf('Location: /%s/', $locale->getCompatibleLocale()));
+die; \ No newline at end of file