Skip to content
Snippets Groups Projects
Commit 2a749ff8 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Rename \SimpleSAML\Locale\Translate::getTranslation() to the more...

Rename \SimpleSAML\Locale\Translate::getTranslation() to the more comprehensive \SimpleSAML\Locale\Translate::getPreferredTranslation().
parent 61712739
Branches
Tags
No related merge requests found
...@@ -127,7 +127,7 @@ class Translate { ...@@ -127,7 +127,7 @@ class Translate {
* @param $translations The translations, as an associative array with language => text mappings. * @param $translations The translations, as an associative array with language => text mappings.
* @return The preferred translation. * @return The preferred translation.
*/ */
public function getTranslation($translations) { public function getPreferredTranslation($translations) {
assert('is_array($translations)'); assert('is_array($translations)');
/* Look up translation of tag in the selected language. */ /* Look up translation of tag in the selected language. */
...@@ -175,14 +175,14 @@ class Translate { ...@@ -175,14 +175,14 @@ class Translate {
if ($extraDict !== NULL) { if ($extraDict !== NULL) {
$dict = $this->getDictionary($extraDict); $dict = $this->getDictionary($extraDict);
if (array_key_exists($normName, $dict)) { if (array_key_exists($normName, $dict)) {
return $this->getTranslation($dict[$normName]); return $this->getPreferredTranslation($dict[$normName]);
} }
} }
/* Search the default attribute dictionary. */ /* Search the default attribute dictionary. */
$dict = $this->getDictionary('attributes'); $dict = $this->getDictionary('attributes');
if (array_key_exists('attribute_' . $normName, $dict)) { if (array_key_exists('attribute_' . $normName, $dict)) {
return $this->getTranslation($dict['attribute_' . $normName]); return $this->getPreferredTranslation($dict['attribute_' . $normName]);
} }
/* No translations found. */ /* No translations found. */
...@@ -240,7 +240,7 @@ class Translate { ...@@ -240,7 +240,7 @@ class Translate {
} }
} }
$translated = $this->getTranslation($tagData); $translated = $this->getPreferredTranslation($tagData);
# if (!empty($replacements)){ echo('<pre> [' . $tag . ']'); print_r($replacements); exit; } # if (!empty($replacements)){ echo('<pre> [' . $tag . ']'); print_r($replacements); exit; }
foreach ($replacements as $k => $v) { foreach ($replacements as $k => $v) {
......
...@@ -32,12 +32,12 @@ class SimpleSAML_XHTML_Template ...@@ -32,12 +32,12 @@ class SimpleSAML_XHTML_Template
/** /**
* @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Locale\Translate::getTranslation() * @deprecated This method will be removed in SSP 2.0. Please use
* instead. * SimpleSAML\Locale\Translate::getPreferredTranslation() instead.
*/ */
public function getTranslation($translations) public function getTranslation($translations)
{ {
return $this->translator->getTranslation($translations); return $this->translator->getPreferredTranslation($translations);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment