PHPackages                             dobron/cldr-plural-rules-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dobron/cldr-plural-rules-parser

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

dobron/cldr-plural-rules-parser
===============================

Export language plural rules from CLDR Supplemental Data

1.0.3(1y ago)06MITPHPPHP ^8.0

Since Jan 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/richardDobron/cldr-plural-rules-parser)[ Packagist](https://packagist.org/packages/dobron/cldr-plural-rules-parser)[ RSS](/packages/dobron-cldr-plural-rules-parser/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

CLDR Plural Rules Parser
========================

[](#cldr-plural-rules-parser)

Export language plural rules from CLDR Supplemental Data.

**Source Data (latest):**

---

📦 Installation
--------------

[](#-installation)

Install the library using Composer:

```
$ composer require dobron/cldr-plural-rules-parser
```

⚡️ Quick Start
--------------

[](#️-quick-start)

### Flush JSON Response

[](#flush-json-response)

```
echo (new \dobron\CLDRSupplementalData\ExportLanguagePluralRules)->flush();
```

### Load Specific Version

[](#load-specific-version)

```
echo (new \dobron\CLDRSupplementalData\ExportLanguagePluralRules)->load('v40');
```

### Save JSON File

[](#save-json-file)

```
(new \dobron\CLDRSupplementalData\ExportLanguagePluralRules)->store('latest.json');
```

Example Data
------------

[](#example-data)

Here is an example of the JSON output:

```
{
  "version": "40.0β",
  "languages": {
    // ...
    "en": {
      "language": "English",
      "cardinal": {
        "one": {
          "examples": "1",
          "pairs": "1 day",
          "rules": "i = 1 and\r\n   v = 0"
        },
        "other": {
          "examples": "0, 2~16, 100, 1000, 10000, 100000, 1000000, … 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
          "pairs": "2 days\r\n1.5 days",
          "rules": ""
        }
      },
      "ordinal": {
        "one": {
          "examples": "1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …",
          "pairs": "Take the 1st right.",
          "rules": "n % 10 = 1 and\r\n   n % 100 != 11"
        },
        "two": {
          "examples": "2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …",
          "pairs": "Take the 2nd right.",
          "rules": "n % 10 = 2 and\r\n   n % 100 != 12"
        },
        "few": {
          "examples": "3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …",
          "pairs": "Take the 3rd right.",
          "rules": "n % 10 = 3 and\r\n   n % 100 != 13"
        },
        "other": {
          "examples": "0, 4~18, 100, 1000, 10000, 100000, 1000000, …",
          "pairs": "Take the 4th right.",
          "rules": ""
        }
      },
      "range": {
        "one+other": {
          "examples": "1–2",
          "pairs": "1–2 days",
          "rules": "one + other → other"
        },
        "other+one": {
          "examples": "0–1",
          "pairs": "0–1 days",
          "rules": "other + one → other"
        },
        "other+other": {
          "examples": "0–2",
          "pairs": "0–2 days",
          "rules": "other + other → other"
        }
      }
    },
    "sk": {
      "language": "Slovak",
      "cardinal": {
        "one": {
          "examples": "1",
          "pairs": "1 deň",
          "rules": "i = 1 and\r\n   v = 0"
        },
        "few": {
          "examples": "2~4",
          "pairs": "2 dni",
          "rules": "i = 2..4 and\r\n   v = 0"
        },
        "many": {
          "examples": "0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
          "pairs": "1,5 dňa",
          "rules": "v != 0"
        },
        "other": {
          "examples": "0, 5~19, 100, 1000, 10000, 100000, 1000000, …",
          "pairs": "5 dní",
          "rules": ""
        }
      },
      "ordinal": {
        "other": {
          "examples": "0~15, 100, 1000, 10000, 100000, 1000000, …",
          "pairs": "Na 15. križovatke odbočte doprava.",
          "rules": ""
        }
      },
      "range": {
        "one+few": {
          "examples": "1–2",
          "pairs": "1 – 2 dni",
          "rules": "one + few → few"
        },
        "one+many": {
          "examples": "1–10.0",
          "pairs": "1 – 10,0 dňa",
          "rules": "one + many → many"
        },
        "one+other": {
          "examples": "1–5",
          "pairs": "1 – 5 dní",
          "rules": "one + other → other"
        },
        "few+few": {
          "examples": "2–4",
          "pairs": "2 – 4 dni",
          "rules": "few + few → few"
        },
        "few+many": {
          "examples": "2–10.0",
          "pairs": "2 – 10,0 dňa",
          "rules": "few + many → many"
        },
        "few+other": {
          "examples": "2–5",
          "pairs": "2 – 5 dní",
          "rules": "few + other → other"
        },
        "many+one": {
          "examples": "0.0–1",
          "pairs": "0,0 – 1 deň",
          "rules": "many + one → one"
        },
        "many+few": {
          "examples": "0.0–2",
          "pairs": "0,0 – 2 dni",
          "rules": "many + few → few"
        },
        "many+many": {
          "examples": "0.0–10.0",
          "pairs": "0,0 – 10,0 dňa",
          "rules": "many + many → many"
        },
        "many+other": {
          "examples": "0.0–5",
          "pairs": "0,0 – 5 dní",
          "rules": "many + other → other"
        },
        "other+one": {
          "examples": "0–1",
          "pairs": "0 – 1 deň",
          "rules": "other + one → one"
        },
        "other+few": {
          "examples": "0–2",
          "pairs": "0 – 2 dni",
          "rules": "other + few → few"
        },
        "other+many": {
          "examples": "0–10.0",
          "pairs": "0 – 10,0 dňa",
          "rules": "other + many → many"
        },
        "other+other": {
          "examples": "0–5",
          "pairs": "0 – 5 dní",
          "rules": "other + other → other"
        }
      }
    }
    // ...
  },
  "equals": {
    "he": [
      "iw"
    ],
    "id": [
      "in"
    ],
    "jv": [
      "jw"
    ],
    "ro": [
      "mo"
    ],
    "sr_Latn": [
      "sh"
    ],
    "fil": [
      "tl"
    ],
    "yi": [
      "ji"
    ]
  }
}
```

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

🙋 Credits
---------

[](#-credits)

- [Richard Dobroň](https://github.com/richardDobron)

⚖️ License
----------

[](#️-license)

This repository is MIT licensed, as found in the [LICENSE](LICENSE) file.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~365 days

Total

4

Last Release

543d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82453617?v=4)[dobron](/maintainers/dobron)[@DOBRON](https://github.com/DOBRON)

---

Top Contributors

[![richardDobron](https://avatars.githubusercontent.com/u/33115305?v=4)](https://github.com/richardDobron "richardDobron (12 commits)")

---

Tags

cldrparserplurals

### Embed Badge

![Health badge](/badges/dobron-cldr-plural-rules-parser/health.svg)

```
[![Health](https://phpackages.com/badges/dobron-cldr-plural-rules-parser/health.svg)](https://phpackages.com/packages/dobron-cldr-plural-rules-parser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M45](/packages/mck89-peast)[kubawerlos/php-cs-fixer-custom-fixers

A set of custom fixers for PHP CS Fixer

24013.1M199](/packages/kubawerlos-php-cs-fixer-custom-fixers)[ergebnis/php-cs-fixer-config

Provides a configuration factory and rule set factories for friendsofphp/php-cs-fixer.

703.0M203](/packages/ergebnis-php-cs-fixer-config)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[redaxo/php-cs-fixer-config

php-cs-fixer config for REDAXO

10105.6k17](/packages/redaxo-php-cs-fixer-config)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
