diff --git a/app/Web/Lang.php b/app/Web/Lang.php index 9979f40..4cc746d 100644 --- a/app/Web/Lang.php +++ b/app/Web/Lang.php @@ -102,4 +102,12 @@ class Lang return $key; } + + /** + * @return string + */ + public function getLang(): string + { + return $this->lang; + } } \ No newline at end of file diff --git a/bootstrap/app.php b/bootstrap/app.php index 5af7076..aa5ab2f 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -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')); diff --git a/resources/templates/base.twig b/resources/templates/base.twig index 6c90b57..1823a93 100644 --- a/resources/templates/base.twig +++ b/resources/templates/base.twig @@ -1,5 +1,5 @@ - + {% block title %}Default{% endblock %} | {{ config.app_name }}