From 3295d96e674961ab943303c02a9066d0fa25fbb3 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 3 Dec 2009 13:58:02 +0000
Subject: [PATCH] SAMLBuilder: Use getLocalizedString.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2025 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Metadata/SAMLBuilder.php | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php
index f890d9f72..5a274e6b6 100644
--- a/lib/SimpleSAML/Metadata/SAMLBuilder.php
+++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php
@@ -330,23 +330,15 @@ class SimpleSAML_Metadata_SAMLBuilder {
 			$attributeconsumer = $this->createElement('AttributeConsumingService');
 			$attributeconsumer->setAttribute('index', '0');
 
-			$name = $metadata->getArrayizeString('name');
+			$name = $metadata->getLocalizedString('name');
 			foreach($name AS $lang => $localname) {
-				if ($lang === 0) {
-					/* We use 'en' as the default language. */
-					$lang = 'en';
-				}
 				$t = $this->createTextElement('ServiceName', $localname);
 				$t->setAttribute('xml:lang', $lang);
 				$attributeconsumer->appendChild($t);
 			}
 
-			$description = $metadata->getArrayizeString('description', array());
+			$description = $metadata->getLocalizedString('description', array());
 			foreach ($description as $lang => $localname) {
-				if ($lang === 0) {
-					/* We use 'en' as the default language. */
-					$lang = 'en';
-				}
 				$t = $this->createTextElement('ServiceDescription', $localname);
 				$t->setAttribute('xml:lang', $lang);
 				$attributeconsumer->appendChild($t);
-- 
GitLab