CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ChainMessagesLoader
  • Date
  • FrozenDate
  • FrozenTime
  • I18n
  • MessagesFileLoader
  • Number
  • PluralRules
  • Time
  • TranslatorRegistry

Traits

  • DateFormatTrait

Class PluralRules

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

Namespace: Cake\I18n
Location: I18n/PluralRules.php

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 , integer|float $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.
integer|float $n
The number to apply the rules to.
Returns
integer
The plural rule number that should be used.
Link
http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals#List_of_Plural_Rules

Properties detail

$_rulesMap ¶

protected static array

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

[
    'af' => 1,
    'am' => 2,
    'ar' => 13,
    'az' => 1,
    'be' => 3,
    'bg' => 1,
    'bh' => 2,
    'bn' => 1,
    'bo' => 0,
    'bs' => 3,
    'ca' => 1,
    'cs' => 4,
    'cy' => 14,
    'da' => 1,
    'de' => 1,
    'dz' => 0,
    'el' => 1,
    'en' => 1,
    'eo' => 1,
    'es' => 1,
    'et' => 1,
    'eu' => 1,
    'fa' => 1,
    'fi' => 1,
    'fil' => 2,
    'fo' => 1,
    'fr' => 2,
    'fur' => 1,
    'fy' => 1,
    'ga' => 5,
    'gl' => 1,
    'gu' => 1,
    'gun' => 2,
    'ha' => 1,
    'he' => 1,
    'hi' => 2,
    'hr' => 3,
    'hu' => 1,
    'id' => 0,
    'is' => 15,
    'it' => 1,
    'ja' => 0,
    'jv' => 0,
    'ka' => 0,
    'km' => 0,
    'kn' => 0,
    'ko' => 0,
    'ku' => 1,
    'lb' => 1,
    'ln' => 2,
    'lt' => 6,
    'lv' => 10,
    'mg' => 2,
    'mk' => 8,
    'ml' => 1,
    'mn' => 1,
    'mr' => 1,
    'ms' => 0,
    'mt' => 9,
    'nah' => 1,
    'nb' => 1,
    'ne' => 1,
    'nl' => 1,
    'nn' => 1,
    'no' => 1,
    'nso' => 2,
    'om' => 1,
    'or' => 1,
    'pa' => 1,
    'pap' => 1,
    'pl' => 11,
    'ps' => 1,
    'pt_pt' => 2,
    'pt' => 1,
    'ro' => 12,
    'ru' => 3,
    'sk' => 4,
    'sl' => 7,
    'so' => 1,
    'sq' => 1,
    'sr' => 3,
    'sv' => 1,
    'sw' => 1,
    'ta' => 1,
    'te' => 1,
    'th' => 0,
    'ti' => 2,
    'tk' => 1,
    'tr' => 1,
    'uk' => 3,
    'ur' => 1,
    'vi' => 0,
    'wa' => 2,
    'zh' => 0,
    'zu' => 1,
]
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs