From eebe3940fcb9ee9ddf8a0482f4b0c14432f401a0 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Mon, 12 Jul 2010 07:58:11 +0000 Subject: [PATCH] Template: Inline calls to getBaseLanguage. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2408 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/XHTML/Template.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index b0460e5be..0031701c7 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -163,13 +163,7 @@ class SimpleSAML_XHTML_Template { return $bestLanguage; } - /** - * Returns the language base (from configuration) - */ - private function getBaseLanguage() { - return 'en'; - } - + /** * Returns the language default (from configuration) */ @@ -293,10 +287,9 @@ class SimpleSAML_XHTML_Template { return $translations[$default_language]; } - /* Look up translation of tag in the base language. */ - $base_language = $this->getBaseLanguage(); - if(array_key_exists($base_language, $translations)) { - return $translations[$base_language]; + /* Check for english translation. */ + if(array_key_exists('en', $translations)) { + return $translations['en']; } /* Pick the first translation available. */ @@ -399,7 +392,7 @@ class SimpleSAML_XHTML_Template { public function includeInlineTranslation($tag, $translation) { if (is_string($translation)) { - $translation = array($this->getBaseLanguage() => $translation); + $translation = array('en' => $translation); } elseif (!is_array($translation)) { throw new Exception("Inline translation should be string or array. Is " . gettype($translation) . " now!"); } -- GitLab