diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-11-09 23:53:47 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-11-10 13:03:05 +0300 |
commit | 913dee125adea39abec363f55e2fb54a42e0c9b8 (patch) | |
tree | 9e4d2e4fad01b51e42b0063b8ef6580b1fdba84e /l10n.php | |
parent | 1b97eccca1e8f21fa832227036c6e110c4808688 (diff) |
Use /de/ for DE
Diffstat (limited to 'l10n.php')
-rw-r--r-- | l10n.php | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -41,10 +41,11 @@ class L10N { * @return string */ private function getCurrentLanguage() { - if(isset($_GET['hl'])) { - $hl = strtolower((string)$_GET['hl']); - if(ctype_alnum($hl) && strlen($hl) === 2) { - return $hl; + $path = parse_url(site_url())['path']; + $language = explode('/', substr($_SERVER['REQUEST_URI'], strlen($path))); + if(isset($language[1]) && strlen($language[1]) === 2) { + if(ctype_alnum($language[1])) { + return $language[1]; } } |