Use language setting of users when logging in.

This commit is contained in:
Jan Böhmer 2019-09-12 17:50:33 +02:00
parent 0dd20394cb
commit 0bfcec77fb
9 changed files with 97 additions and 8 deletions

View file

@ -78,7 +78,8 @@ class AppExtension extends AbstractExtension
new TwigFilter('bbCode', [$this, 'parseBBCode'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
new TwigFilter('moneyFormat', [$this, 'formatCurrency']),
new TwigFilter('siFormat', [$this, 'siFormat']),
new TwigFilter('amountFormat', [$this, 'amountFormat'])
new TwigFilter('amountFormat', [$this, 'amountFormat']),
new TwigFilter('loginPath', [$this, 'loginPath'])
];
}
@ -104,6 +105,19 @@ class AppExtension extends AbstractExtension
return $this->serializer->serialize($tree, 'json', ['skip_null_values' => true]);
}
/**
* This function/filter generates an path
* @param string $path
* @return string
*/
public function loginPath(string $path) : string
{
$parts = explode("/" ,$path);
//Remove the part with
unset($parts[1]);
return implode("/", $parts);
}
public function generateEntityURL(DBElement $entity, string $method = 'info'): string
{
return $this->entityURLGenerator->getURL($entity, $method);