public function DataCollectorTranslator::trans in Plug 7
Translates the given message.
@api
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
Overrides TranslatorInterface::trans
File
- lib/
Symfony/ translation/ DataCollectorTranslator.php, line 48
Class
- DataCollectorTranslator
- @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
Namespace
Symfony\Component\TranslationCode
public function trans($id, array $parameters = array(), $domain = null, $locale = null) {
$trans = $this->translator
->trans($id, $parameters, $domain, $locale);
$this
->collectMessage($locale, $domain, $id, $trans);
return $trans;
}