From 1b2abab6ddbb3460b8981a296fe04477a42801b3 Mon Sep 17 00:00:00 2001 From: NumEricR Date: Mon, 26 Aug 2013 22:25:03 +0200 Subject: [PATCH] Add lang attribute in html tag --- inc/poche/Tools.class.php | 5 +++++ index.php | 1 + tpl/layout.twig | 1 + 3 files changed, 7 insertions(+) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 3a792d43..1ab90be1 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 7b775c41..52a400a8 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 07ca231c..bb20075a 100644 --- a/tpl/layout.twig +++ b/tpl/layout.twig @@ -4,6 +4,7 @@ + -- 2.41.0