PHPackages                             adlanarifzr/translatr - 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. adlanarifzr/translatr

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

adlanarifzr/translatr
=====================

A simple trait to translate data from database through Laravel model

v0.0.1(8y ago)444MITPHP

Since Jan 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/adlanarifzr/translatr)[ Packagist](https://packagist.org/packages/adlanarifzr/translatr)[ RSS](/packages/adlanarifzr-translatr/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Table of Contents
--------------------------------------------------------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Support &amp; Thanks](#support)
- [License]($license)

Introduction
============

[](#introduction)

To display a translated static text might be easy with Laravel, yet to display a translated data from database/model would usually require a little bit of efforts and lines of code. Translatr helps to simplify the translation concept by integrating a simple trait into the Models without having to have extra tables and such.

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

[](#installation)

1. Install the package through composer

```
composer require adlanarifzr/translatr

```

2. Use the Translatr in your Model

```
use Translatr\Translatr;

class ModelName extends Model
{
    use Translatr;
}
```

Usage
-----

[](#usage)

You can translate any data in your database by adding column name with `_locale` at the end of the column/attribute name. For example `description_en` for English and `description_my` for Malay language.

```
echo $model->description;
```

This command will display the description based on your current locale. To add more language, simply add new column with different locale.

Support &amp; Thanks
-------------------------------------------------------

[](#support--thanks)

I would be really grateful if you would contribute to support my development in Laravel packages. I can be reached at .

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3091d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/adlanarifzr-translatr/health.svg)

```
[![Health](https://phpackages.com/badges/adlanarifzr-translatr/health.svg)](https://phpackages.com/packages/adlanarifzr-translatr)
```

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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