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
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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);
}
......
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