aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-05-28 09:13:59 +0000
committerRomain d'Alverny <rda@mageia.org>2012-05-28 09:13:59 +0000
commitba349804e6efd2823d1d55ab71b78d54345230f1 (patch)
tree93242f74c19d04dbe6849bdb4f124180a5923a1a
parentf69e8c59454cca94b53b1a3f094c923b44992b17 (diff)
downloadnav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar
nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.gz
nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.bz2
nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.xz
nav-ba349804e6efd2823d1d55ab71b78d54345230f1.zip
return the right sub language
-rw-r--r--lib.php11
1 files changed, 6 insertions, 5 deletions
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';
}