From e482ecfb87cc4a323691088de39d0b878105b861 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 22 Jul 2020 01:53:00 +0000 Subject: [PATCH] [I18N] Remove support for context until it proves necessary, as it broke the code --- src/Core/I18n/I18n.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Core/I18n/I18n.php b/src/Core/I18n/I18n.php index 2cd810e445..f528c69f2f 100644 --- a/src/Core/I18n/I18n.php +++ b/src/Core/I18n/I18n.php @@ -309,16 +309,6 @@ function _m(): string // Falthrough // no break case 2: - if (is_string($args[0])) { - if (!is_array($args[1])) { - // ASCII 4 is EOT, used to separate context from string - $context = array_shift($args) . '\004'; - } else { - throw new InvalidArgumentException('Bad parameters to `_m()`. ' - . 'Seemingly called with a context and multiple messages'); - } - } - if (is_array($args[0])) { $args[0] = I18n::formatICU($args[0], $args[1]); } @@ -326,7 +316,7 @@ function _m(): string if (is_string($args[0])) { $msg = $args[0]; $params = $args[1] ?? []; - return I18n::$translator->trans($context ?? '' . $msg, $params, $domain); + return I18n::$translator->trans($msg, $params, $domain); } // Fallthrough // no break