From 21e4d3aa7aa61acb2e911e265fcf550a606ea75e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Sun, 11 May 2008 14:18:21 +0000
Subject: [PATCH] Made consent module possible to translate.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@536 44740490-163a-0410-bde0-09ae8108e29a
---
 dictionaries/consent.php      | 182 ++++++++++++++++++++++++++++++++++
 templates/default/consent.php |  26 ++---
 2 files changed, 196 insertions(+), 12 deletions(-)
 create mode 100644 dictionaries/consent.php

diff --git a/dictionaries/consent.php b/dictionaries/consent.php
new file mode 100644
index 000000000..a30e1ff64
--- /dev/null
+++ b/dictionaries/consent.php
@@ -0,0 +1,182 @@
+<?php
+
+// consentadmin dictionary
+
+/*
+	'' => array(
+		'en' => '',
+		'no' => '',
+		'nn' => '',
+        'da' => '',
+		'es' => '',
+		'fr' => '',
+		'de' => '',
+		'nl' => '',
+		'lu' => '',
+		'sl' => '',
+	),
+
+
+* 
+* */
+
+
+$lang = array(
+
+// WAYF: Additional attributes START
+
+	'attribute_org' => array(
+		'en' => 'Organisation',
+		'da' => 'Organisation',
+	),
+
+	'attribute_id' => array(
+		'en' => 'Id',
+		'da' => 'Id',
+	),
+
+	'attribute_injected' => array(
+		'en' => 'Injected attribute',
+		'da' => 'Injiceret attribut',
+	),
+	
+// WAYF: Additional attributes END
+
+
+'yes' => array(
+		'en' => 'yes',
+		'no' => 'ja',
+		'nn' => 'ja',
+        'da' => 'ja',
+//		'es' => '',
+		'fr' => 'oui',
+		'de' => 'ja',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+	),
+
+'no' => array(
+		'en' => 'no',
+		'no' => 'nej',
+		'nn' => 'nej',
+        'da' => 'nej',
+//		'es' => 'no',
+		'fr' => 'non',
+		'de' => 'nein',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+	),
+	
+	
+	'remember' => array(
+		'en' => 'remember consent',
+		'no' => 'husk samtykke',
+		//'nn' => '',
+        'da' => 'husk samtykke',		
+//		'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+		),
+		
+	
+	'consent_notice' => array(
+		'en' => 'You are about to login to the service',
+		'no' => 'Du er ved at logge pĂĄ servicen',
+//		'nn' => '',
+        'da' => 'Du er ved at logge ind pĂĄ servicen',
+//		'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+	),
+
+	'consent_accept' => array(
+		'en' => 'In the login proccess, the identity provider will send attributes containing information about your identity to this service. Do you accept this?',
+//		'no' => '',
+//		'nn' => '',
+        'da' => 'I login processen vil din Identity Provider sende attributter som indeholder oplysninger om din identitet til denne service. Vil du acceptere dette?',
+//	    'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+		),
+		
+		
+	'login' => array(
+		'en' => 'login',
+//		'no' => '',
+//		'nn' => '',
+        'da' => 'login',
+//		'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+	),
+		   		
+	'service_providers_for' => array(
+		'en' => 'Service Providers for',
+		'no' => 'Service Providers for',
+		'nn' => 'Service Providers for',
+        'da' => 'Service Providers for',
+//	    'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+		),
+		
+  
+  
+  'service_provider_header' => array(
+		'en' => 'Service Provider',
+		'no' => 'Service Provider',
+		'nn' => 'Service Provider',
+        'da' => 'Service Provider',
+	    'es' => 'Service Provider',
+		'fr' => 'Service Provider',
+		'de' => 'Service Provider',
+		'nl' => 'Service Provider',
+		'lu' => 'Service Provider',
+		'sl' => 'Service Provider',
+		),
+		
+	'status_header' => array(
+		'en' => 'Consent status',
+		'no' => 'Samtykke status',
+		//'nn' => '',
+        'da' => 'Samtykke status',		
+//		'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+		),
+		
+	'show_hide_attributes' => array(
+		'en' => 'show/hide attributes',
+		'no' => 'vis/skjul attributter',
+		//'nn' => 'vis/skjul attributter',
+        'da' => 'vis/skjul attributter',		
+//		'es' => '',
+//		'fr' => '',
+//		'de' => '',
+//		'nl' => '',
+//		'lu' => '',
+//		'sl' => '',
+		),
+		
+);
+
diff --git a/templates/default/consent.php b/templates/default/consent.php
index 7e548321b..db4284a79 100644
--- a/templates/default/consent.php
+++ b/templates/default/consent.php
@@ -1,23 +1,27 @@
 <?php $this->includeAtTemplateBase('includes/header.php'); ?>
-
+<?php
+//array('SP'=>
+   $this->includeLanguageFile('consent.php'); 
+   $this->includeInlineTranslation('spname', $this->data['sp_name']);
+   //$this->includeInlineTranslation('spdescription', $this->data['description']);
+?>
 
 	<div id="content">
-
-		<p>You are about to login to the service <strong><?php echo htmlspecialchars($this->data['sp_name']); ?></strong>. In the login proccess, the identity provider will send attributes containing information about your identity to this service. Do you accept this?</p>
-		
-
-
+[default]
+		<p><?php echo htmlspecialchars($this->t('consent_notice')); ?> <strong><?php echo htmlspecialchars($this->t('spname', false, true) ); ?></strong>.
+		<?php echo htmlspecialchars($this->t('consent_accept')) ?> 
+		</p>
 
 		<form action="<?php echo htmlspecialchars($this->data['consenturl']); ?>">
-			<input type="submit" value="Yes" />
+			<input type="submit" value="<?php echo htmlspecialchars($this->t('yes')) ?>" />
 			<input type="hidden" name="consent" value="<?php echo htmlspecialchars($this->data['consent_cookie']); ?>" />
 			<input type="hidden" name="RequestID" value="<?php echo htmlspecialchars($this->data['requestid']); ?>" />
 			<?php if($this->data['usestorage']) { ?>
-				<input type="checkbox" name="saveconsent" id="saveconsent" value="1" /> remember consent
+				<input type="checkbox" name="saveconsent" id="saveconsent" value="1" /> <?php echo htmlspecialchars($this->t('remember')) ?>
 			<?php } ?>
 		</form>
 		<form action="<?php echo htmlspecialchars($this->data['noconsent']); ?>" method="GET">
-			<input type="submit" value="No" />
+			<input type="submit" value="<?php echo htmlspecialchars($this->t('no')) ?>" />
 		</form>
 
 
@@ -26,15 +30,13 @@
 
 		<table style="font-size: x-small">
 <?php
-
-
 			$attributes = $this->data['attributes'];
 			foreach ($attributes AS $name => $value) {
 					
 				if (isset($this->data['attribute_' . htmlspecialchars(strtolower($name)) ])) {
 				  $name = $this->data['attribute_' . htmlspecialchars(strtolower($name))];
 			  }
-					
+				$name = $this->t('attribute_'.strtolower($name), true); // translate	
 				if (sizeof($value) > 1) {
 					echo '<tr><td>' . htmlspecialchars($name) . '</td><td><ul>';
 					foreach ($value AS $v) {
-- 
GitLab