diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-05-28 09:13:59 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-05-28 09:13:59 +0000 |
commit | ba349804e6efd2823d1d55ab71b78d54345230f1 (patch) | |
tree | 93242f74c19d04dbe6849bdb4f124180a5923a1a /lib.php | |
parent | f69e8c59454cca94b53b1a3f094c923b44992b17 (diff) | |
download | nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.gz nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.bz2 nav-ba349804e6efd2823d1d55ab71b78d54345230f1.tar.xz nav-ba349804e6efd2823d1d55ab71b78d54345230f1.zip |
return the right sub language
Diffstat (limited to 'lib.php')
-rw-r--r-- | lib.php | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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'; } |