Skip to content
Snippets Groups Projects
Commit eebe3940 authored by Olav Morken's avatar Olav Morken
Browse files

Template: Inline calls to getBaseLanguage.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2408 44740490-163a-0410-bde0-09ae8108e29a
parent 72a70897
No related branches found
No related tags found
No related merge requests found
...@@ -163,13 +163,7 @@ class SimpleSAML_XHTML_Template { ...@@ -163,13 +163,7 @@ class SimpleSAML_XHTML_Template {
return $bestLanguage; return $bestLanguage;
} }
/**
* Returns the language base (from configuration)
*/
private function getBaseLanguage() {
return 'en';
}
/** /**
* Returns the language default (from configuration) * Returns the language default (from configuration)
*/ */
...@@ -293,10 +287,9 @@ class SimpleSAML_XHTML_Template { ...@@ -293,10 +287,9 @@ class SimpleSAML_XHTML_Template {
return $translations[$default_language]; return $translations[$default_language];
} }
/* Look up translation of tag in the base language. */ /* Check for english translation. */
$base_language = $this->getBaseLanguage(); if(array_key_exists('en', $translations)) {
if(array_key_exists($base_language, $translations)) { return $translations['en'];
return $translations[$base_language];
} }
/* Pick the first translation available. */ /* Pick the first translation available. */
...@@ -399,7 +392,7 @@ class SimpleSAML_XHTML_Template { ...@@ -399,7 +392,7 @@ class SimpleSAML_XHTML_Template {
public function includeInlineTranslation($tag, $translation) { public function includeInlineTranslation($tag, $translation) {
if (is_string($translation)) { if (is_string($translation)) {
$translation = array($this->getBaseLanguage() => $translation); $translation = array('en' => $translation);
} elseif (!is_array($translation)) { } elseif (!is_array($translation)) {
throw new Exception("Inline translation should be string or array. Is " . gettype($translation) . " now!"); throw new Exception("Inline translation should be string or array. Is " . gettype($translation) . " now!");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment