From eb6b12e232bffbefbf97c4ba7bdb855bd83fdcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Wed, 27 Feb 2008 14:13:41 +0000 Subject: [PATCH] Added support for translating attribute names to different languages. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@323 44740490-163a-0410-bde0-09ae8108e29a --- dictionaries/attributes.php | 18 ++++++++++++++++++ templates/default/en/status.php | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 dictionaries/attributes.php diff --git a/dictionaries/attributes.php b/dictionaries/attributes.php new file mode 100644 index 000000000..2a6a389df --- /dev/null +++ b/dictionaries/attributes.php @@ -0,0 +1,18 @@ +<?php + +$lang = array( + 'en' => array( + 'attribute_mail' => 'E-Mail', + 'attribute_edupersonaffiliation' => 'Affiliation', + 'attribute_title' => 'Title', + 'attribute_uid' => 'User ID', + + ), + 'no' => array( + 'attribute_mail' => 'E-post', + 'attribute_edupersonaffiliation' => 'Tilhørighet', + 'attribute_title' => 'Tittel', + 'attribute_uid' => 'BrukerID', + ) + +); \ No newline at end of file diff --git a/templates/default/en/status.php b/templates/default/en/status.php index a766dbc15..8918d341e 100644 --- a/templates/default/en/status.php +++ b/templates/default/en/status.php @@ -17,6 +17,11 @@ $attributes = $data['attributes']; foreach ($attributes AS $name => $value) { + + if (isset($this->data['attribute_' . htmlspecialchars($name) ])) { + $name = $this->data['attribute_' . htmlspecialchars($name) ]; + } + if (sizeof($value) > 1) { echo '<tr><td>' . htmlspecialchars($name) . '</td><td><ul>'; foreach ($value AS $v) { -- GitLab