From 13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Mon, 29 Nov 2010 15:00:41 +0000 Subject: new languages selector --- index.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'index.php') 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 -- cgit v1.2.1