PHPackages                             codiliateur/trans-helpers - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. codiliateur/trans-helpers

ActivePackage[Localization &amp; i18n](/categories/localization)

codiliateur/trans-helpers
=========================

Useful translation extensions

v1.0.1(2y ago)010MITPHPPHP ^8.0

Since Dec 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/codiliateur/trans-helpers)[ Packagist](https://packagist.org/packages/codiliateur/trans-helpers)[ RSS](/packages/codiliateur-trans-helpers/feed)WikiDiscussions main Synced 1mo ago

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

trans-helpers
=============

[](#trans-helpers)

To install run command

```
composer require codiliateur/trans-helpers

```

Package provides next helper functions

function trans\_r
-----------------

[](#function-trans_r)

```
trans_r($key, $replaces, $locale)

```

All parameters are the same as in the standard `trans()`

If you have a translation key that assigned to array of translations, this function guarantees to get missing translations from the fallback locale for all missing end-keys.

### Example

[](#example)

./lang/**en**/models/person.php

```
return [
    "attributes" => [
        "id" => "ID",
        "first_name" => "First Name",
        "last_name" => "Last Name",
        "age" => "Age",
    ]
];

```

./lang/**fr**/models/person.php

```
return [
    "attributes" => [
        "first_name" => "Prénome",
        "last_name" => "Nom de famille",
    ]
];

```

If you call standard function `trans` then you obtain just key translations from **fr** lang-file. Call

```
trans('models/person.attributes', [], 'fr')

```

returns

```
[
    "first_name" => "Prénome",          // 'fr'
    "last_name" => "Nom de famille",    // 'fr'
];

```

But call `trans_r`

```
`trans_r('models/person.attributes', [], 'fr')`

```

returns all keys

```
[
    "id" => "ID",                       // 'en' - fallback locale
    "first_name" => "Prénome",          // 'fr'
    "last_name" => "Nom de famille",    // 'fr'
    "age" => "Age",                     // 'en' - fallback locale
];

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~0 days

Total

2

Last Release

897d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9f2d90d10001bd0e403d32d36a87500b8d3fdce01c26b7aad5cb4aa930f60fb?d=identicon)[codiliator](/maintainers/codiliator)

---

Top Contributors

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

---

Tags

laraveltranslationscodiliateur

### Embed Badge

![Health badge](/badges/codiliateur-trans-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/codiliateur-trans-helpers/health.svg)](https://phpackages.com/packages/codiliateur-trans-helpers)
```

###  Alternatives

[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)[genl/matice

Use your Laravel translations in JavaScript. Generates a Blade directive exporting all of your Laravel translations and provides a nice trans() helper function in JavaScript.

101339.4k2](/packages/genl-matice)[statikbe/laravel-chained-translator

The Laravel Chained Translator can combine several translators that can override each others translations.

36149.4k6](/packages/statikbe-laravel-chained-translator)[vildanbina/laravel-auto-translation

A Laravel package for automating the translation of language files.

9220.5k2](/packages/vildanbina-laravel-auto-translation)[cactus-galaxy/filament-astrotomic

Filament support for Astrotomic's Laravel Translatable package.

2516.3k](/packages/cactus-galaxy-filament-astrotomic)[square-bit/laravel-pt-localization

Portuguese Localization package for Laravel

113.6k](/packages/square-bit-laravel-pt-localization)

PHPackages © 2026

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