From ba349804e6efd2823d1d55ab71b78d54345230f1 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Mon, 28 May 2012 09:13:59 +0000 Subject: return the right sub language --- lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib.php') diff --git a/lib.php b/lib.php index bde2ee9..28b72cf 100644 --- a/lib.php +++ b/lib.php @@ -110,10 +110,8 @@ function _mgnav_style() */ function _lang_check($s = null) { - if (!is_null($s)) { - $sub = explode('-', $s); - $sub = strtolower($sub[0]); - } + if (is_null($s)) + return 'en'; $supported = array( 'cs', @@ -134,8 +132,11 @@ function _lang_check($s = null) if (in_array($s, $supported)) return $s; + $sub = explode('-', $s); + $sub = strtolower($sub[0]); + if (in_array($sub, $supported)) - return $s; + return $sub; return 'en'; } -- cgit v1.2.1