From e6ead78b24a14bf6e25ad2a8a869d5ad11aa1f5e Mon Sep 17 00:00:00 2001 From: Hanne Moa <hanne.moa@uninett.no> Date: Thu, 15 Sep 2016 10:37:38 +0200 Subject: [PATCH] Deprecate the use of arrays for t($tag) For #455 --- lib/SimpleSAML/Locale/Translate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php index 29ac3768b..888c0773e 100644 --- a/lib/SimpleSAML/Locale/Translate.php +++ b/lib/SimpleSAML/Locale/Translate.php @@ -248,7 +248,7 @@ class Translate * provided in $replacements, and replace any found occurrences with the value of the key. * * @param string|array $tag A tag name for the translation which should be looked up, or an array with - * (language => text) mappings. + * (language => text) mappings. The array version will go away in 2.0 * @param array $replacements An associative array of keys that should be replaced with values in the * translated string. * @param boolean $fallbackdefault Default translation to use as a fallback if no valid translation was found. @deprecated Not used in twig, gettext @@ -293,6 +293,10 @@ class Translate if (is_array($tag)) { $tagData = $tag; + \SimpleSAML\Logger::warning( + 'Deprecated use of new SimpleSAML\Locale\Translate::t(...) at '.$where. + '. The $tag-parameter can only be a string in 2.0.' + ); } else { $tagData = $this->getTag($tag); if ($tagData === null) { -- GitLab