You are here

public function TranslatorInterface::trans in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/TranslatorInterface.php \Symfony\Component\Translation\TranslatorInterface::trans()

Translates the given message.

Parameters

string $id The message id (may also be an object that can be cast to string):

array $parameters An array of parameters for the message:

string|null $domain The domain for the message or null to use the default:

string|null $locale The locale or null to use the default:

Return value

string The translated string

Throws

\InvalidArgumentException If the locale contains invalid characters

6 methods override TranslatorInterface::trans()
DataCollectorTranslator::trans in vendor/symfony/translation/DataCollectorTranslator.php
Translates the given message.
DefaultTranslator::trans in vendor/symfony/validator/DefaultTranslator.php
Interpolates the given message.
DrupalTranslator::trans in core/lib/Drupal/Core/Validation/DrupalTranslator.php
Translates the given message.
IdentityTranslator::trans in vendor/symfony/translation/IdentityTranslator.php
Translates the given message.
LoggingTranslator::trans in vendor/symfony/translation/LoggingTranslator.php
Translates the given message.

... See full list

File

vendor/symfony/translation/TranslatorInterface.php, line 33

Class

TranslatorInterface
TranslatorInterface.

Namespace

Symfony\Component\Translation

Code

public function trans($id, array $parameters = array(), $domain = null, $locale = null);