]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add lang attribute in html tag
authorNumEricR <eric.github@gmail.com>
Mon, 26 Aug 2013 20:25:03 +0000 (22:25 +0200)
committerNumEricR <eric.github@gmail.com>
Sat, 14 Sep 2013 08:06:59 +0000 (10:06 +0200)
inc/poche/Tools.class.php
index.php
tpl/layout.twig

index 3a792d43acbaf85bdcb45c737953c17e5eab34eb..1ab90be18b66ea088bc046d34e9062ce6eb2b006 100644 (file)
@@ -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
index 7b775c41609868000250babef09c7e1cd77006ca..52a400a84a37b7147ba0bab0585011808e2b30ca 100644 (file)
--- 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(),
index 07ca231c004135b8ef3012cc9dd883e6515ad9c3..bb20075ac7bb5558e6e84c4f5249025e99fd3a6a 100644 (file)
@@ -4,6 +4,7 @@
 <!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]-->
 <!--[if gt IE 8]><html class="no-js" lang="en"><![endif]-->
 <html>
+<html lang="{{ lang }}">
     <head>
         <meta name="viewport" content="initial-scale=1.0">
         <meta charset="utf-8">