DefaultTranslator deprecated::trans()

string trans(string $id, array $parameters = array(), string|null $domain = null, string|null $locale = null)

Interpolates the given message.

Parameters are replaced in the message in the same manner that {@link strtr()} uses.

Example usage:

$translator = new DefaultTranslator();

echo $translator->trans(
    'This is a {{ var }}.',
    array('{{ var }}' => 'donkey')
);

// -> This is a donkey.

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
doc_Symfony
2016-10-28 06:13:38
Comments
Leave a Comment

Please login to continue.