PHPackages                             dn23rus/laravel-translation-rules - 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. dn23rus/laravel-translation-rules

ActiveLibrary

dn23rus/laravel-translation-rules
=================================

v1.0.0(10y ago)011PHP

Since Sep 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dn23rus/laravel-translation-rules)[ Packagist](https://packagist.org/packages/dn23rus/laravel-translation-rules)[ RSS](/packages/dn23rus-laravel-translation-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Overview
--------

[](#overview)

This package gives ability to use translation rules.

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

[](#installation)

`composer require dn23rus/laravel-translation-rules`

Configuration
-------------

[](#configuration)

Add service provider to config/app.php

```
    'providers' => [
        //...
        Dmbur\TranslationRule\TranslationRuleServiceProvider::class
    ]
```

Run the command:

`php artisan vendor:publish`

to publish translation\_rules.php

Usage
-----

[](#usage)

Now you can add rule to `resources/lang/translation_rules.php`, for example rule for Russian language:

```
    'ru' => function ($n) {
        return ($n % 10 == 1 && $n % 100 != 11) ? 0 :
            ($n % 10 >= 2 && $n % 10 = 20) ? 1 : 2);
    },
```

And example of message in file `resource/lang/ru/app.php`:

```
    'apple' => '{0}яблоко|{1}яблока|{2}яблок'
```

So

```
echo 5 . ' ' . trans_rule('app.apple', 5) // will produce 5 яблок
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3887d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e840caaa7c3df06849405106bec51f7c8a73d0d240806af0c079ccffa4c59f9e?d=identicon)[b.dmitry](/maintainers/b.dmitry)

---

Top Contributors

[![dn23rus](https://avatars.githubusercontent.com/u/2236266?v=4)](https://github.com/dn23rus "dn23rus (5 commits)")

### Embed Badge

![Health badge](/badges/dn23rus-laravel-translation-rules/health.svg)

```
[![Health](https://phpackages.com/badges/dn23rus-laravel-translation-rules/health.svg)](https://phpackages.com/packages/dn23rus-laravel-translation-rules)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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