From 3289d2033f4b5e3b9ea6d435002b1da76c793b65 Mon Sep 17 00:00:00 2001 From: Hanne Moa <hanne.moa@uninett.no> Date: Wed, 14 Sep 2016 09:37:09 +0200 Subject: [PATCH] Remove concat: translated tab-title For #455. Note that if translation tags were domain-free strings, the mapping from tab to tabtitle would be redundant. It would still be necessary to mark the strings as noop however. --- modules/discopower/lib/PowerIdPDisco.php | 15 +++++++++++++++ modules/discopower/templates/disco.tpl.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/discopower/lib/PowerIdPDisco.php b/modules/discopower/lib/PowerIdPDisco.php index a5b237551..7a1d8b592 100644 --- a/modules/discopower/lib/PowerIdPDisco.php +++ b/modules/discopower/lib/PowerIdPDisco.php @@ -248,6 +248,21 @@ class sspmod_discopower_PowerIdPDisco extends SimpleSAML_XHTML_IdPDisco $preferredIdP = $this->getRecommendedIdP(); $t = new SimpleSAML_XHTML_Template($this->config, 'discopower:disco.tpl.php', 'disco'); + $discoPowerTabs = array( + 'denmark' => $t->noop('{discopower:tabs:denmark}'), + 'edugain' => $t->noop('{discopower:tabs:edugain}'), + 'finland' => $t->noop('{discopower:tabs:finland}'), + 'greece' => $t->noop('{discopower:tabs:greece}'), + 'iceland' => $t->noop('{discopower:tabs:iceland}'), + 'incommon' => $t->noop('{discopower:tabs:incommon}'), + 'kalmar' => $t->noop('{discopower:tabs:kalmar}'), + 'misc' => $t->noop('{discopower:tabs:misc}'), + 'norway' => $t->noop('{discopower:tabs:norway}'), + 'sweden' => $t->noop('{discopower:tabs:sweden}'), + 'switzerland' => $t->noop('{discopower:tabs:switzerland}'), + 'ukacessfederation' => $t->noop('{discopower:tabs:ukacessfederation}'), + ); + $t->data['tabNames'] = $discoPowerTabs; $t->data['idplist'] = $idpList; $t->data['preferredidp'] = $preferredIdP; $t->data['return'] = $this->returnURL; diff --git a/modules/discopower/templates/disco.tpl.php b/modules/discopower/templates/disco.tpl.php index d8059babd..2e9afd681 100644 --- a/modules/discopower/templates/disco.tpl.php +++ b/modules/discopower/templates/disco.tpl.php @@ -136,7 +136,7 @@ if (!empty($faventry)) { $tabs = array_keys( $this->data['idplist']); foreach ($tabs AS $tab) { if(!empty($this->data['idplist'][$tab])) { - echo '<li><a href="#' . $tab . '"><span>' . $this->t('{discopower:tabs:' . $tab . '}') . '</span></a></li> '; + echo '<li><a href="#' . $tab . '"><span>' . $this->t($this->data['tabNames'][$tab]) . '</span></a></li> '; } } -- GitLab