diff options
author | Romain d'Alverny <rda@mageia.org> | 2010-11-29 15:00:41 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2010-11-29 15:00:41 +0000 |
commit | 13e4eb1b5964ebbb8a984ac70b86b8aa28bcac1f (patch) | |
tree | 2eeec72912cddfe338a360bd0f7f313af64cb100 /index.php | |
parent | 977c8d761c014fb4ae36185c12ec9c827f0e122d (diff) | |
download | www-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.php | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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 |