PHPackages                             jva91/translation - 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. jva91/translation

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

jva91/translation
=================

Laravel package for database translations

06PHP

Since May 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jva91/translation)[ Packagist](https://packagist.org/packages/jva91/translation)[ RSS](/packages/jva91-translation/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Jva91/Translation
-----------------

[](#jva91translation)

A easy package to manage database translations for Laravel

### Installation

[](#installation)

#### Using composer

[](#using-composer)

```
composer require jva91/translation

```

or manually add in `composer.json`

```
"require": {

    "jva91/translation": "0.1.x-dev"
}

```

After add this line run `composer install`

This package package contains auto discovery. When auto discovery is disabled register the service provider in `config/app.php`

```
 'providers' => [
    // ...
    Jva91\Translation\TranslationServiceProvider::class,
 ]

```

### Publishing

[](#publishing)

This package publishes a config file.

```
php artisan vendor:publish --provider="Jva91\Translation\TranslationServiceProvider" --tag="config"

```

### Migration

[](#migration)

This package contains a default migration this will be executed with

```
php artisan migrate

```

### Model

[](#model)

This package contains a default model

```
Jva91\Translation\Models\Translation

```

### Usage

[](#usage)

The package can be used by using the delivered trait `Jva91\Translation\Traits\TranslationsTrait`

```
class FakeModel extends Model
{
    use TranslationsTrait;

    public static $transFields = ['name'];
    // ...

```

`$transFields` are the columns in the table. This column must be an integer so the trait can store his translation.key integer in this column. There can be multiple columns in this array.

The trait uses the `config('app.locale')` setting. The extra translatable locales can be set in the config file `translation.php`

```
'locales' => [
    'en_GB'
  ],

```

To get translation with the default `app.locale`

```
$fakeModel->name

```

To get translation with a default locale

```
$fakeModel->name_en_GB

```

To get the translation key integer from the model

```
$fakeModel->getOriginalTranslationKey('name')

```

To delete a translation for a specific locale

```
$fakeModel->deleteForLocale('name', 'nl_NL');

```

### Testing

[](#testing)

This package is covered by unit tests

### Feature functions

[](#feature-functions)

- Console command to delete unused translations from table

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1218541?v=4)[Jason van Altena](/maintainers/jva91)[@jva91](https://github.com/jva91)

---

Top Contributors

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

---

Tags

laraveltranslations

### Embed Badge

![Health badge](/badges/jva91-translation/health.svg)

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

###  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)
