From 2a749ff8b824fd698bce96e6d3fd001ac0d0e670 Mon Sep 17 00:00:00 2001
From: Jaime Perez Crespo <jaime.perez@uninett.no>
Date: Fri, 5 Feb 2016 13:49:39 +0100
Subject: [PATCH] Rename \SimpleSAML\Locale\Translate::getTranslation() to the
 more comprehensive \SimpleSAML\Locale\Translate::getPreferredTranslation().

---
 lib/SimpleSAML/Locale/Translate.php | 8 ++++----
 lib/SimpleSAML/XHTML/Template.php   | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php
index e16300542..75352ae11 100644
--- a/lib/SimpleSAML/Locale/Translate.php
+++ b/lib/SimpleSAML/Locale/Translate.php
@@ -127,7 +127,7 @@ class Translate {
      * @param $translations  The translations, as an associative array with language => text mappings.
      * @return The preferred translation.
      */
-    public function getTranslation($translations) {
+    public function getPreferredTranslation($translations) {
         assert('is_array($translations)');
 
         /* Look up translation of tag in the selected language. */
@@ -175,14 +175,14 @@ class Translate {
         if ($extraDict !== NULL) {
             $dict = $this->getDictionary($extraDict);
             if (array_key_exists($normName, $dict)) {
-                return $this->getTranslation($dict[$normName]);
+                return $this->getPreferredTranslation($dict[$normName]);
             }
         }
 
         /* Search the default attribute dictionary. */
         $dict = $this->getDictionary('attributes');
         if (array_key_exists('attribute_' . $normName, $dict)) {
-            return $this->getTranslation($dict['attribute_' . $normName]);
+            return $this->getPreferredTranslation($dict['attribute_' . $normName]);
         }
 
         /* No translations found. */
@@ -240,7 +240,7 @@ class Translate {
             }
         }
 
-        $translated = $this->getTranslation($tagData);
+        $translated = $this->getPreferredTranslation($tagData);
 
 #        if (!empty($replacements)){        echo('<pre> [' . $tag . ']'); print_r($replacements); exit; }
         foreach ($replacements as $k => $v) {
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index fd1d44e03..2074810fc 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -32,12 +32,12 @@ class SimpleSAML_XHTML_Template
 
 
     /**
-     * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Locale\Translate::getTranslation()
-     * instead.
+     * @deprecated This method will be removed in SSP 2.0. Please use
+     * SimpleSAML\Locale\Translate::getPreferredTranslation() instead.
      */
     public function getTranslation($translations)
     {
-        return $this->translator->getTranslation($translations);
+        return $this->translator->getPreferredTranslation($translations);
     }
 
 
-- 
GitLab