diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 3a792d4..1ab90be 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -248,4 +248,9 @@ class Tools fclose($fp); } } + + public static function getDocLanguage($userlanguage) { + $lang = explode('.', $userlanguage); + return str_replace('_', '-', $lang[0]); + } } \ No newline at end of file diff --git a/index.php b/index.php index 7b775c4..52a400a 100644 --- a/index.php +++ b/index.php @@ -50,6 +50,7 @@ elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { # vars to send to templates $tpl_vars = array( + 'lang' => Tools::getDocLanguage($poche->user->getConfigValue('language')), 'referer' => $referer, 'view' => $view, 'poche_url' => Tools::getPocheUrl(), diff --git a/tpl/layout.twig b/tpl/layout.twig index 07ca231..bb20075 100644 --- a/tpl/layout.twig +++ b/tpl/layout.twig @@ -4,6 +4,7 @@ +