diff --git a/core/lib/Drupal/Core/Validation/TranslatorInterface.php b/core/lib/Drupal/Core/Validation/TranslatorInterface.php index 9fbd42e5c348a3cf2e748c9daff58ac15ca965a1..b7722a9e3f6097ceba8cae6f0d52ef853b5ed2b4 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); }