Class PluralRules

Utility class used to determine the plural number to be used for a variable base on the locale

Namespace: Cake\I18n

Properties summary

  • $_rulesMap protected static
    array

    A map of locale => plurals group used to determine which plural rules apply to the language

Method Summary

  • calculate() public static

    Returns the plural form number for the passed locale corresponding to the countable provided in $n.

Method Detail

calculate() public static

calculate(string $locale, mixed $n)

Returns the plural form number for the passed locale corresponding to the countable provided in $n.

Parameters

string $locale

The locale to get the rule calculated for.

int $n

The number to apply the rules to.

Returns

int

The plural rule number that should be used.

Links

Property Detail

$_rulesMap protected static

A map of locale => plurals group used to determine which plural rules apply to the language

Type

array

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.I18n.PluralRules.html