Skip to content

Commit

Permalink
fix translations
Browse files Browse the repository at this point in the history
  • Loading branch information
ioigoume committed Dec 4, 2023
1 parent 99f9b19 commit 5182d3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Binary file added locales/en/LC_MESSAGES/userid.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Controller/ErrorReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public function main(Request $request, string $as = null): Template

$parameters = json_decode(base64_decode(urldecode($parameters)));

Logger::debug('parameters:' . var_export($parameters, true));

// redirect the user back to this page to clear the POST request
$t = new Template($this->config, 'userid:errorreport.twig');
$t->data['errorCode'] = $errorCode;
foreach ($parameters as $key => $val) {
$t->data[$key] = $val;
}

Logger::debug('[ErrorReport]::main::data' . var_export($t->data, true));

$twig = $t->getTwig();
// TWIG does not have an htmlspecialchars function. We will pass in the one from php
$twig->addFunction(new TwigFunction('htmlspecialchars', 'htmlspecialchars'));
Expand Down
14 changes: 7 additions & 7 deletions templates/errorreport.twig
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{% set pagetitle = 'userid:error:header'|trans %}
{% set pagetitle = ('header'|trans) %}
{% set header = ('header'|trans) %}

{% extends "base.twig" %}


{% block content %}
<h2>{{ 'userid:error:title' | trans }}</h2>
<h2>{{ 'title'|trans }}</h2>
<p>
{% trans with {
'%IDPNAME%': idpname
} %}{{ "userid:error:descr_" ~ errorCode }}{% endtrans %}
{{ ('descr_' ~ errorCode)|trans({'%IDPNAME%': idpname}) }}
</p>
<p>
<a href="{{ BASEDIR|htmlspecialchars ~ 'saml2/idp/initSLO.php?RelayState=' ~ RESTARTURL|url_encode }}">
{{ 'userid:error:retry' | trans }}
<a href="{{ basedir ~ 'saml2/idp/initSLO.php?RelayState=' ~ (returnurl|url_encode) }}">
{{ 'retry' | trans }}
</a>
</p>
{% endblock %}

0 comments on commit 5182d3a

Please sign in to comment.