aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNumEricR <eric.github@gmail.com>2013-08-26 22:25:03 +0200
committerNumEricR <eric.github@gmail.com>2013-09-14 10:06:59 +0200
commit1b2abab6ddbb3460b8981a296fe04477a42801b3 (patch)
treecf1fc1503cf7a4e7da5dae7dd6ece8fc7b33c2c3
parent10ab20d8e21b2fa3f4d8e86909a7cb4d0d9a84d2 (diff)
downloadwallabag-1b2abab6ddbb3460b8981a296fe04477a42801b3.tar.gz
wallabag-1b2abab6ddbb3460b8981a296fe04477a42801b3.tar.zst
wallabag-1b2abab6ddbb3460b8981a296fe04477a42801b3.zip
Add lang attribute in html tag
-rw-r--r--inc/poche/Tools.class.php5
-rw-r--r--index.php1
-rw-r--r--tpl/layout.twig1
3 files changed, 7 insertions, 0 deletions
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
248 fclose($fp); 248 fclose($fp);
249 } 249 }
250 } 250 }
251
252 public static function getDocLanguage($userlanguage) {
253 $lang = explode('.', $userlanguage);
254 return str_replace('_', '-', $lang[0]);
255 }
251} \ No newline at end of file 256} \ 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'])) {
50 50
51# vars to send to templates 51# vars to send to templates
52$tpl_vars = array( 52$tpl_vars = array(
53 'lang' => Tools::getDocLanguage($poche->user->getConfigValue('language')),
53 'referer' => $referer, 54 'referer' => $referer,
54 'view' => $view, 55 'view' => $view,
55 'poche_url' => Tools::getPocheUrl(), 56 '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 @@
4<!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]--> 4<!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]-->
5<!--[if gt IE 8]><html class="no-js" lang="en"><![endif]--> 5<!--[if gt IE 8]><html class="no-js" lang="en"><![endif]-->
6<html> 6<html>
7<html lang="{{ lang }}">
7 <head> 8 <head>
8 <meta name="viewport" content="initial-scale=1.0"> 9 <meta name="viewport" content="initial-scale=1.0">
9 <meta charset="utf-8"> 10 <meta charset="utf-8">