diff --git a/templates/includes/attributes.php b/templates/includes/attributes.php
index b5177638006c0b55766bbb6f3a6d3b438fa44cd1..48eb0cc78c9c9b4d509d3f2d7d16863bb8225115 100644
--- a/templates/includes/attributes.php
+++ b/templates/includes/attributes.php
@@ -30,7 +30,7 @@ function present_assoc($attr) {
 	}
 }
 
-function present_attributes($t, $attributes, $nameParent) {
+function present_attributes(SimpleSAML_XHTML_Template $t, $attributes, $nameParent) {
 	$alternate = array('odd', 'even'); $i = 0;
 	
 	$parentStr = (strlen($nameParent) > 0)? strtolower($nameParent) . '_': '';
@@ -40,7 +40,7 @@ function present_attributes($t, $attributes, $nameParent) {
 	foreach ($attributes as $name => $value) {
 	
 		$nameraw = $name;
-		$name = $t->translator->getAttributeTranslation($parentStr . $nameraw);
+		$name = $t->getTranslator()->getAttributeTranslation($parentStr . $nameraw);
 
 		if (preg_match('/^child_/', $nameraw)) {
 			$parentName = preg_replace('/^child_/', '', $nameraw);
diff --git a/templates/includes/header.php b/templates/includes/header.php
index c787f8783b09e43130ff85ac3277dfdd9e776b96..3982c8bf519af985b782bdf593f479e07be19057 100644
--- a/templates/includes/header.php
+++ b/templates/includes/header.php
@@ -191,7 +191,7 @@ if($onLoad !== '') {
 				if ($current) {
 					$textarray[] = $langnames[$lang];
 				} else {
-					$textarray[] = '<a href="' . htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters(\SimpleSAML\Utils\HTTP::getSelfURL(), array($this->translator->language->languageParameterName => $lang))) . '">' .
+					$textarray[] = '<a href="' . htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters(\SimpleSAML\Utils\HTTP::getSelfURL(), array($this->getTranslator()->language->languageParameterName => $lang))) . '">' .
 						$langnames[$lang] . '</a>';
 				}
 			}