From dd054699a40bfe62b65e5063864c37c01ab2c3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=CC=81bor=20Hojtsy?= Date: Tue, 26 Feb 2019 13:54:26 +0100 Subject: [PATCH] =?UTF-8?q?Issue=20#3030485=20by=20catch,=20R.shaikh,=20G?= =?UTF-8?q?=C3=A1bor=20Hojtsy,=20alexpott:=20[Symfony=205]=20The=20"Drupal?= =?UTF-8?q?\Core\Validation\TranslatorInterface"=20interface=20extends=20"?= =?UTF-8?q?Symfony\Component\Translation\TranslatorInterface"=20that=20is?= =?UTF-8?q?=20deprecated=20since=20Symfony=204.2,=20use=20Symfony\Contract?= =?UTF-8?q?s\Translation\TranslatorInterface=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Validation/TranslatorInterface.php | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Validation/TranslatorInterface.php b/core/lib/Drupal/Core/Validation/TranslatorInterface.php index 9fbd42e5c348..b7722a9e3f60 100644 --- a/core/lib/Drupal/Core/Validation/TranslatorInterface.php +++ b/core/lib/Drupal/Core/Validation/TranslatorInterface.php @@ -2,18 +2,35 @@ namespace Drupal\Core\Validation; -use Symfony\Component\Translation\TranslatorInterface as SymfonyTranslatorInterface; - /** * Defines an interface used in validation. * - * This extends the interface used by the Symfony validator in order to indicate - * that the Drupal code is actually independent from the Symfony translation - * component. + * This replaces the interface used by the Symfony validator in order + * to indicate that the Drupal code is actually independent from the + * Symfony translation component. * * @see https://github.com/symfony/symfony/pull/6189 * @see https://github.com/symfony/symfony/issues/15714 */ -interface TranslatorInterface extends SymfonyTranslatorInterface { +interface TranslatorInterface { + + /** + * Translates the given message. + * + * @param string $id + * The message id (may also be an object that can be cast to string). + * @param array $parameters + * An array of parameters for the message. + * @param string|null $domain + * The domain for the message or null to use the default. + * @param string|null $locale + * The locale or null to use the default. + * @return string + * The translated string. + * + * @throws InvalidArgumentException + * If the locale contains invalid characters. + */ + public function trans($id, array $parameters = [], $domain = NULL, $locale = NULL); }