From cab879d9ff51ec9bad205336b0e648ed5bf9f1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no> Date: Thu, 22 Aug 2019 13:59:30 +0200 Subject: [PATCH] Start using the new attribute translations --- modules/core/lib/Controller.php | 2 ++ templates/auth_status.twig | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/core/lib/Controller.php b/modules/core/lib/Controller.php index 44f3ead04..efc1799d5 100644 --- a/modules/core/lib/Controller.php +++ b/modules/core/lib/Controller.php @@ -84,6 +84,8 @@ class Controller $attributes = $auth->getAttributes(); $t = new Template($this->config, 'auth_status.twig', 'attributes'); + $l = $t->getLocalization(); + $l->addDomain($l->getLocaleDir(), 'attributes'); $t->data['header'] = '{status:header_saml20_sp}'; $t->data['attributes'] = $attributes; $t->data['nameid'] = !is_null($auth->getAuthData('saml:sp:NameID')) diff --git a/templates/auth_status.twig b/templates/auth_status.twig index 41b5f3fca..bb56e9a47 100644 --- a/templates/auth_status.twig +++ b/templates/auth_status.twig @@ -17,9 +17,8 @@ {% embed '_table.twig' -%} {% block namecol -%} - {% set attr = ('{attributes:attribute_'~(name|lower)~'}') %} - {% set translated = attr|trans %} - <td class="attrname">{% if translated != attr %} {{ translated }} <br>{% endif %} <samp>{{ name }}</samp></td> + {% set translated = name|trans %} + <td class="attrname">{% if translated != name %} {{ translated }} <br>{% endif %} <samp>{{ name }}</samp></td> {% endblock %} -- GitLab