class MailTranslator implements TranslatorInterface

The translator email views are given.

Behaves like the ordinary translator except that parameter values are replaced by markers instead of being substituted directly, so that they are not present when {\Flarum\Mail\MailFormatter} renders the result. The markers are swapped back, escaped, once rendering is done. Email templates therefore need no changes — including those in extensions that will never be updated — while a discussion title or display name can no longer inject markup into a notification.

Methods

__construct(TranslatorInterface $translator)

No description

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

No description

string
get($key, array $replace = [], $locale = null)

No description

string
choice($key, $number, array $replace = [], $locale = null)

No description

string
getLocale()

No description

void
setLocale($locale)

No description

Details

__construct(TranslatorInterface $translator)

Parameters

TranslatorInterface $translator

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

Parameters

$id
array $parameters
$domain
$locale

Return Value

string

string get($key, array $replace = [], $locale = null)

Parameters

$key
array $replace
$locale

Return Value

string

string choice($key, $number, array $replace = [], $locale = null)

Parameters

$key
$number
array $replace
$locale

Return Value

string

string getLocale()

Return Value

string

void setLocale($locale)

Parameters

$locale

Return Value

void