You are here

public function TranslatorInterface::transChoice in Plug 7

Translates the given choice message by choosing a translation according to a number.

@api

Parameters

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

int $number The number to use to find the indice of the message:

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

5 methods override TranslatorInterface::transChoice()
DataCollectorTranslator::transChoice in lib/Symfony/translation/DataCollectorTranslator.php
Translates the given choice message by choosing a translation according to a number.
DefaultTranslator::transChoice in lib/Symfony/validator/Symfony/Component/Validator/DefaultTranslator.php
Interpolates the given choice message by choosing a variant according to a number.
IdentityTranslator::transChoice in lib/Symfony/translation/IdentityTranslator.php
@api
LoggingTranslator::transChoice in lib/Symfony/translation/LoggingTranslator.php
Translates the given choice message by choosing a translation according to a number.
Translator::transChoice in lib/Symfony/translation/Translator.php
@api

File

lib/Symfony/translation/TranslatorInterface.php, line 54

Class

TranslatorInterface
TranslatorInterface.

Namespace

Symfony\Component\Translation

Code

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