Commit 4d03d6a2 authored by Avris's avatar Avris

Split translations into namespaces

parent 521bf55f
......@@ -75,21 +75,18 @@ final class TwigEngine implements EngineInterface, EventSubscriberInterface
[$helper, 'canAccess']
));
if (class_exists('Symfony\Component\VarDumper\Dumper\HtmlDumper')) {
$cloner = new VarCloner();
$htmlDumper = new HtmlDumper();
$cliDumper = new CliDumper();
$this->twig->addFunction(new TwigFunction(
'dump',
function ($var, $html = true) use ($cloner, $htmlDumper, $cliDumper) {
$dumper = $html ? $htmlDumper : $cliDumper;
return $dumper->dump($cloner->cloneVar($var), true);
},
['is_safe' => ['html']]
));
}
$cloner = new VarCloner();
$htmlDumper = new HtmlDumper();
$cliDumper = new CliDumper();
$this->twig->addFunction(new TwigFunction(
'dump',
function ($var, $html = true) use ($cloner, $htmlDumper, $cliDumper) {
$dumper = $html ? $htmlDumper : $cliDumper;
return $dumper->dump($cloner->cloneVar($var), true);
},
['is_safe' => ['html']]
));
}
public function render(string $template, array $vars): string
......
{% extends 'layout' %}
{% block content %}
<h3>{{ 'Error %code%'|l({'%code%': errorCode}) }}</h3>
<p><a href="{{ route('home') }}"><span class="fa fa-home"></span> {{ 'Back to homepage'|l }}</a></p>
<h3>{{ 'error:header'|l({'%code%': errorCode}) }}</h3>
<p><a href="{{ route('home') }}"><span class="fa fa-home"></span> {{ 'error:backToHome'|l }}</a></p>
{% endblock %}
header: Fehler %code%
backToHome: Zurück zur Homepage
header: Error %code%
backToHome: Back to homepage
header: Błąd %code%
backToHome: Wróć na stronę startową
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment