mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-08 00:22:59 +01:00
Use the user-set language in twig filter
This commit is contained in:
@@ -10,6 +10,7 @@ class AdminTwigExtension extends \Twig_Extension
|
||||
public function __construct()
|
||||
{
|
||||
$this->grav = Grav::instance();
|
||||
$this->lang = $this->grav['user']->language;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,6 @@ class AdminTwigExtension extends \Twig_Extension
|
||||
|
||||
public function tuFilter()
|
||||
{
|
||||
return $this->grav['language']->translate(func_get_args());
|
||||
return $this->grav['language']->translate(func_get_args(), [$this->grav['user']->authenticated ? $this->lang : 'en']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user