PHPackages                             oblik/kirby-plurals - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. oblik/kirby-plurals

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

oblik/kirby-plurals
===================

Advanced pluralization for Kirby.

1.0.0(6y ago)172621MITPHP

Since Mar 30Pushed 6y ago5 watchersCompare

[ Source](https://github.com/OblikStudio/kirby-plurals)[ Packagist](https://packagist.org/packages/oblik/kirby-plurals)[ RSS](/packages/oblik-kirby-plurals/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

kirby-plurals
=============

[](#kirby-plurals)

Allows you to use language variables to translate a string according to that language's plural forms defined in [the Unicode CLDR](http://www.unicode.org/cldr/charts/27/supplemental/language_plural_rules.html). For more information, check [php-pluralization](https://github.com/OblikStudio/php-pluralization) which is a dependency of this plugin.

Installation
------------

[](#installation)

With [Composer](https://packagist.org/packages/oblik/kirby-plurals):

```
composer require oblik/kirby-plurals

```

Usage
-----

[](#usage)

You get a `tp()` (translate plural) helper function that works similar to other [helper functions](https://getkirby.com/docs/reference/templates/helpers) and especially, [`tc()`](https://getkirby.com/docs/reference/templates/helpers/tc).

Here's an example language file *en.php*:

```
return [
    'code' => 'en',
    'default' => true,
    'name' => 'English',
    'translations' => [
        'apples' => [
            'one' => '{{ count }} apple',
            'other' => '{{ count }} apples'
        ],
        'place' => [
            'one' => '{{ position }}st',
            'two' => '{{ position }}nd',
            'few' => '{{ position }}rd',
            'other' => '{{ position }}th'
        ],
        'cookies' => [
            'other' => '{{ start }}-{{ end }} cookies'
        ]
    ]
];
```

You can translate:

- cardinals, by using a `count` key
- ordinals, by using a `position` key
- ranges, by using a `start` and an `end` key

```
tp('apples', [ 'count' => 1 ]);                 // 1 apple
tp('apples', [ 'count' => 3 ]);                 // 3 apples
tp('place', [ 'position' => 1 ]);               // 1st
tp('place', [ 'position' => 103 ]);             // 103rd
tp('cookies', [ 'start' => 3, 'end' => 4 ]);    // 3-4 cookies
```

### Locale Mapping

[](#locale-mapping)

If you're using different locale names, you can map them with the `oblik.plurals.map` config option. For example, if you have two languages `en-us` and `en-gb`, you need to map them both to the `en` pluralizator class since both of them have the same pluralization rules:

`site/config/config.php`

```
return [
    'oblik.plurals.map' => [
        'en-us' => 'en',
        'en-gb' => 'en'
    ]
];
```

Check the available pluralization classes [here](https://github.com/OblikStudio/php-pluralization/blob/master/index.php).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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

Unknown

Total

1

Last Release

2236d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/078077710a1481f0419521ab1e1d3e5f93723aadd56148937ee3e355b93acb2e?d=identicon)[hdodov](/maintainers/hdodov)

---

Top Contributors

[![yandodov](https://avatars.githubusercontent.com/u/5570098?v=4)](https://github.com/yandodov "yandodov (8 commits)")[![neildaniels](https://avatars.githubusercontent.com/u/417182?v=4)](https://github.com/neildaniels "neildaniels (3 commits)")

### Embed Badge

![Health badge](/badges/oblik-kirby-plurals/health.svg)

```
[![Health](https://phpackages.com/badges/oblik-kirby-plurals/health.svg)](https://phpackages.com/packages/oblik-kirby-plurals)
```

###  Alternatives

[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14689.4k1](/packages/distantnative-retour-for-kirby)[mzur/kirby-uniform

A versatile Kirby plugin to handle web form actions.

26068.3k13](/packages/mzur-kirby-uniform)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[thathoff/kirby-git-content

Plugin to track changes to content in a git repository.

15343.7k](/packages/thathoff-kirby-git-content)[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11237.3k1](/packages/sylvainjule-locator)[tobimori/kirby-seo

The default choice for SEO on Kirby: Implement technical SEO &amp; Meta best practices with ease and provide an easy-to-use editor experience

10039.7k1](/packages/tobimori-kirby-seo)

PHPackages © 2026

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