Documentation

TranslatorTrait

A trait to help implement TranslatorInterface and LocaleAwareInterface.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$locale  : mixed
getLocale()  : string
{@inheritdoc}
setLocale()  : mixed
{@inheritdoc}
trans()  : string
{@inheritdoc}
getPluralizationRule()  : int
Returns the plural position to use for the given locale and number.

Properties

Methods

getLocale()

{@inheritdoc}

public getLocale() : string
Return values
string

setLocale()

{@inheritdoc}

public setLocale(string $locale) : mixed
Parameters
$locale : string
Return values
mixed

trans()

{@inheritdoc}

public trans(string|null $id[, array<string|int, mixed> $parameters = [] ][, string|null $domain = null ][, string|null $locale = null ]) : string
Parameters
$id : string|null
$parameters : array<string|int, mixed> = []
$domain : string|null = null
$locale : string|null = null
Return values
string

getPluralizationRule()

Returns the plural position to use for the given locale and number.

private getPluralizationRule(float $number, string $locale) : int

The plural rules are derived from code of the Zend Framework (2010-09-25), which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

Parameters
$number : float
$locale : string
Return values
int

Search results