W3cubDocs

/Symfony 2.7

Symfony\Component\Translation\PluralizationRules

class PluralizationRules

Returns the plural rules for a given locale.

Methods

static int get(int $number, string $locale)

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

static set(string $rule, string $locale)

Overrides the default plural rule for a given locale.

Details

static public int get(int $number, string $locale)

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

Parameters

int $number The number
string $locale The locale

Return Value

int The plural position

static public set(string $rule, string $locale)

Overrides the default plural rule for a given locale.

Parameters

string $rule A PHP callable
string $locale The locale

Exceptions

LogicException

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Translation/PluralizationRules.html