Consistent html lang attribute

This commit is contained in:
Sergio Brighenti 2018-11-19 19:38:47 +01:00
parent 586385c3fe
commit deab83f737
3 changed files with 10 additions and 2 deletions

View file

@ -102,4 +102,12 @@ class Lang
return $key;
}
/**
* @return string
*/
public function getLang(): string
{
return $this->lang;
}
}

View file

@ -82,7 +82,7 @@ $container['view'] = function ($container) use (&$config) {
$view->getEnvironment()->addGlobal('request', $container->get('request'));
$view->getEnvironment()->addGlobal('alerts', Session::getAlert());
$view->getEnvironment()->addGlobal('session', Session::all());
$view->getEnvironment()->addGlobal('lang', $container->get('lang'));
$view->getEnvironment()->addGlobal('current_lang', $container->get('lang')->getLang());
$view->getEnvironment()->addGlobal('PLATFORM_VERSION', PLATFORM_VERSION);
$view->getEnvironment()->addFunction(new Twig_Function('route', 'route'));

View file

@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="{{ current_lang }}">
<head>
<title>{% block title %}Default{% endblock %} | {{ config.app_name }}</title>
<meta charset="utf-8">