PHPackages                             kfriars/laravel-translations-manager - 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. kfriars/laravel-translations-manager

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

kfriars/laravel-translations-manager
====================================

A tool to manage translations in Laravel

1.2.0(5y ago)3123MITPHPPHP ^7.2CI failing

Since Aug 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kfriars/laravel-translations-manager)[ Packagist](https://packagist.org/packages/kfriars/laravel-translations-manager)[ Docs](https://github.com/kfriars/laravel-translations-manager)[ RSS](/packages/kfriars-laravel-translations-manager/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (12)Versions (4)Used By (0)

Laravel Translations Manager
============================

[](#laravel-translations-manager)

[![Packagist PHP Version Support](https://camo.githubusercontent.com/839335e78fe74ee0773984ebed0d3edd457660b045a0822234a5be23aa4ee700/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765723f636f6c6f723d253233346363643938266c6162656c3d706870266c6f676f3d706870266c6f676f436f6c6f723d253233666666)](https://camo.githubusercontent.com/839335e78fe74ee0773984ebed0d3edd457660b045a0822234a5be23aa4ee700/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765723f636f6c6f723d253233346363643938266c6162656c3d706870266c6f676f3d706870266c6f676f436f6c6f723d253233666666)[![Laravel Version Support](https://camo.githubusercontent.com/d553f516ae51520ef8b3941d1e9e48ae76293ada136bda224306188303a6f01c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d362e782c253230372e782c253230382e782d2532333433643339393f6c6f676f3d6c61726176656c266c6f676f436f6c6f723d253233666666666666)](https://camo.githubusercontent.com/d553f516ae51520ef8b3941d1e9e48ae76293ada136bda224306188303a6f01c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d362e782c253230372e782c253230382e782d2532333433643339393f6c6f676f3d6c61726176656c266c6f676f436f6c6f723d253233666666666666)[![Latest Version on Packagist](https://camo.githubusercontent.com/ca6018ada5db46aa78d2fb6a30978c936e5553d851a73b0df91b7b97ce732eb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765722e7376673f636f6c6f723d253233346363643938267374796c653d666c61742d737175617265)](https://packagist.org/packages/kfriars/laravel-translations-manager)[![Total Downloads](https://camo.githubusercontent.com/c67a1dda3ed472827da7369687caa4a5ab6dadc58398037459617c0a577aaf2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765722e7376673f636f6c6f723d253233346363643938267374796c653d666c61742d737175617265)](https://packagist.org/packages/kfriars/laravel-translations-manager)[![GitHub Workflow Status](https://camo.githubusercontent.com/88eed28b6407a571ae4881f3a6fdfe28fb3b79a7417890e6bc90b4045828c5c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765722f54657374733f636f6c6f723d253233346363643938266c6162656c3d5465737473266c6f676f3d676974687562266c6f676f436f6c6f723d253233666666)](https://github.com/kfriars/laravel-translations-manager/actions?query=workflow%3ATests)[![Code Climate coverage](https://camo.githubusercontent.com/32090396119bb311efa54c6388914dcd1d9e302ca381bfbe113a11259f128e88/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765723f636f6c6f723d253233346363643938266c6162656c3d74657374253230636f766572616765266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/kfriars/laravel-translations-manager/test_coverage)[![Code Climate maintainability](https://camo.githubusercontent.com/56a986bd88ff44eab4328534820b0d6673ec5bbcb0b9f2803066cc6ef3691a5e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6b6672696172732f6c61726176656c2d7472616e736c6174696f6e732d6d616e616765723f636f6c6f723d253233346363643938266c6162656c3d6d61696e7461696e61626c696c697479266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d253233666666)](https://codeclimate.com/github/kfriars/laravel-translations-manager/maintainability)

Why use this Package?
---------------------

[](#why-use-this-package)

Have you ever worked on a project with multiple locales to be supported, created a new branch, worked for a few days, then wondered exactly what translations you have added or changed? If so, you know it is time intensive and error prone for developers to be managing what translations need to be added or updated.

This package's intended purpose is to make this entire process a breeze. Want to know what has been updated, deleted and added? Simple. Want to export everything needing to be translated to a file that can be sent to a translator? No problem. Want to automatically update all of the files that were translated so there are no more errors? Done.

Contents
--------

[](#contents)

- [Laravel Translations Manager](#laravel-translations-manager)
    - [Why use this Package?](#why-use-this-package)
    - [Contents](#contents)
    - [Installation](#installation)
    - [Reference Locale](#reference-locale)
    - [Workflow](#workflow)
        - [1) Check for errors](#1check-for-errors)
        - [2) Clean Up Dead Translations](#2clean-up-dead-translations)
        - [3) Ignoring Errors](#3ignoring-errors)
        - [4) Fix-File Generation](#4fix-file-generation)
        - [5) Fixing Files](#5fixing-files)
        - [6) Validating Translations](#6validating-translations)
        - [7) Locking Translations](#7locking-translations)
        - [8) Create PR and Merge](#8create-pr-and-merge)
    - [Commands](#commands)
        - [Validate](#validate)
        - [Errors](#errors)
        - [Clean](#clean)
        - [Ignore](#ignore)
        - [Unignore](#unignore)
        - [Generate Fixes](#generate-fixes)
        - [Fix](#fix)
        - [Status](#status)
    - [Testing](#testing)
    - [Changelog](#changelog)
    - [Contributing](#contributing)
    - [Security](#security)
    - [Credits](#credits)
    - [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require kfriars/laravel-translations-manager
```

This package should work out of the box without any changes to configuration. However, you can publish the config file using:

```
php artisan vendor:publish --provider="Kfriars\TranslationsManager\TranslationsManagerServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Laravel Lang Directory
    |--------------------------------------------------------------------------
    |
    | This value is the path to laravels 'lang' folder. This value is used to
    | find your applications translations files using __() and Trans
    |
    */

    'lang_dir' => resource_path('lang'),

    /*
    |--------------------------------------------------------------------------
    | Reference Locales
    |--------------------------------------------------------------------------
    |
    | This is the locale that the development team or a developer works in.
    | This setting assumes all changes to translations files are being made in
    | this locale.
    |
    */

    'reference_locale' => config('app.locale'),

    /*
    |--------------------------------------------------------------------------
    | Supported Locales
    |--------------------------------------------------------------------------
    |
    | These are the locales supported by your application. By default, the
    | Supported locales are all folders listed in the lang directory. You can
    | override the setting if you do not want all locales to be validated using
    | this package.
    |
    */

    // 'supported_locales' => [],

    /*
    |--------------------------------------------------------------------------
    | Fix Files
    |--------------------------------------------------------------------------
    |
    | The fix files are used to fix errors in the translations.
    |
    | 'formatter' is the class that will be used to write and parse the fix files.
    | The default format is a JSON format, since it is easily readable by humans
    | and reliably parseable. You can implement your own formatter as long as it
    | implements the FormatterContract, and use it by changing the setting below.
    |
    | 'fix_name_format' is the way fix files will be named. The currently
    | supported formats are 'git' and 'date'.
    |
    | 'git'  format is 'fixes-{locale}-{git branch name}.txt'
    | 'date' format is 'fixes-{locale}-{Y-m-d}.txt'
    |
    */
    'formatter' => Kfriars\TranslationsManager\TranslationsFixesJSONFormatter::class,
    'fix_name_format' => 'git',
];
```

Reference Locale
----------------

[](#reference-locale)

The reference locale is the language your development team uses for development. This package is built around the idea that the current reference locale's translations are the correct version of the translations for the project.

For example:

You are working on a project for a French company but the project also supports English, German and Spanish. The mock-ups are given in French, so you make French the default app locale, and create translations files in French first. Then everything is translated to English, German and Spanish after the fact. French would be the reference locale.

Workflow
--------

[](#workflow)

*Assume standard git-flow is used, where the `master` branch gets deployed to production and the `develop` branch should be kept in a deployable state.*

This package is intended to be used as part of a project's workflow. For a branch to be in a deploayble state there should be no translation errors.

When a `feature` branch is completed, and ready to make a pull request to `develop`, the following steps should be taken to ensure there are no translation errors.

### 1) Check for errors

[](#1check-for-errors)

This command will list all translation errors in your project.

```
php artisan translations:errors
```

Example output:

```
There are 9 error(s) in the translations files:

+-------------+-------------------------------+
| de/common                                   |
+-------------+-------------------------------+
| Key         | Message                       |
+-------------+-------------------------------+
| company     | translation_missing           |
+-------------+-------------------------------+

+-------------+-------------------------------+
| de/contact                                  |
+-------------+-------------------------------+
| Key         | Message                       |
+-------------+-------------------------------+
| email       | translation_missing           |
+-------------+-------------------------------+
| straße      | no_reference_translation      |
+-------------+-------------------------------+
| phone       | reference_translation_updated |
+-------------+-------------------------------+

+------------+----------------------+
| de/admin                          |
+------------+----------------------+
| Key        | Message              |
+------------+----------------------+
| FILE_ERROR | file_not_translated  |
+------------+----------------------+

+-------------+-------------------------------+
| en/contact                                  |
+-------------+-------------------------------+
| Key         | Message                       |
+-------------+-------------------------------+
| phone       | reference_translation_updated |
+-------------+-------------------------------+

+------------+----------------------+
| en/admin                          |
+------------+----------------------+
| Key        | Message              |
+------------+----------------------+
| FILE_ERROR | file_not_translated  |
+------------+----------------------+

+-------------+---------------------+
| es/contact                        |
+-------------+---------------------+
| Key         | Message             |
+-------------+---------------------+
| FILE_ERROR  | file_not_translated |
+-------------+---------------------+

+------------+----------------------+
| es/admin                          |
+------------+----------------------+
| Key        | Message              |
+------------+----------------------+
| FILE_ERROR | file_not_translated  |
+------------+----------------------+
```

**Error Types:**

ErrorDescription**translation\_missing**This error is when a translation is present in the reference locale, but not present in one of the supported locales.**file\_not\_translated**This error is when an entire translations file from the reference locale is not present in one of the supported locales.**reference\_translation\_updated**This error occurs when a locked translation of the reference locale does not match the current translation in the reference locale. This error helps you know what you have changed in your current branch, so it can be updated in the supported locales.**no\_reference\_translation**This error occurs when a supported locale has a translation that cannot be found in the reference locale. This error is for eliminating dead translations.**incorrect\_translation\_type**This error occurs when translation keys match in the reference and supported locales, but their types are different### 2) Clean Up Dead Translations

[](#2clean-up-dead-translations)

```
php artisan translations:clean de en es
```

The `no_reference_translation` errors likely indicate dead translations from removing keys in the reference locale, and forgetting to remove them in the supported locales. After you have inspected all of these errors and ensured they are in fact dead translations, you can run the clean command to remove all of these keys from your the supported locales.

### 3) Ignoring Errors

[](#3ignoring-errors)

```
php artisan translations:ignore locale file key?
```

If there are any translations that do not need to be maintained in the supported locales, then those errors can be ignored. In the example output from `#1`, it is likely the admin interface's translations do need to be translated.

As such, they can be ignored using:

```
php artisan translations:ignore de admin
php artisan translations:ignore en admin
php artisan translations:ignore es admin
```

### 4) Fix-File Generation

[](#4fix-file-generation)

```
php artisan translations:generate-fixes de en es
```

Now that all remaining errors require some action, fix-files can be generated containing all translations required to fix the errors in each locale. This file is intended to be sent to a translator, and returned in its current format. The files are in JSON since it is human readable, and reliably parseable.

By default, the files are generated with the naming pattern `fixes-{locale}-{git-branch-name}.txt`. These files are saved in the configured `fixes_dir`. The default is `storage/translations/fixes`.

The following fix files would be generated using French as the reference locale.

`fixes-de-feature-xzy.txt`

```
{
    "reference": "fr",
    "locale": "de",
    "files": [{
        "file": "common",
        "translations": {
            "company": "Compagnie"
        }
    }, {
        "file": "contact",
        "translations": {
            "email": "Adresse électronique",
            "phone": "Numéro de téléphone",
        }
    }]
}
```

`fixes-en-feature-xzy.txt`

```
{
    "reference": "fr",
    "locale": "en",
    "files": [{
        "file": "contact",
        "translations": {
            "phone": "Numéro de téléphone"
        }
    }],
}
```

`fixes-es-feature-xzy.txt`

```
{
    "reference": "fr",
    "locale": "es",
    "files": [{
        "file": "contact",
        "translations": {
            "first_name": "Prénom",
            "last_name": "Nom de famille",
            "email": "Adresse électronique",
            "phone": "Numéro de téléphone",
        }
    }],
}
```

### 5) Fixing Files

[](#5fixing-files)

When the fix files have been completed and returned by the translator, you can place them in the configured `fixed_dir`. The default is `storage/translations/fixed`. Once the files have been placed in the directory you can run the following command.

```
php artisan translations:fix de en es
```

It is important to note, that this command will remove all translations with `no_reference_translation` errors from the supported locales.

Also, any translations that have `reference_translations_updated` and were included in the fix file, will have their lockfile updated with the current reference locale translation.

### 6) Validating Translations

[](#6validating-translations)

Now you can test whether there are any translation errors by running the following command:

```
php artisan translations:validate
```

If the output is `Validation Passed`, then you can move on to the next step. I strongly recommend you add this command and ensure it passes in your ci/cd flow for deployments to production.

### 7) Locking Translations

[](#7locking-translations)

If validation has failed due to `reference_translation_updated` errors, but you are satisfied with the state of the supported locales translations, you can lock the current state of the reference locale's translations by running the following command:

```
php artisan translations:lock

```

This will eliminate all `reference_translation_updated` errors.

### 8) Create PR and Merge

[](#8create-pr-and-merge)

Once translations validation passes, you are ready to merge your code!

Commands
--------

[](#commands)

### Validate

[](#validate)

Signature: `php artisan translations:validate locales?* --no-ignore`

Determine if there are any errors present in the specified locales. If no locales are provided all supported locales will be validated.

ArgumentRequiredDescriptionExample Valueslocales✗The locales you want to ensure are valid.de, en, es, frOptionsDescriptionExample Valuesno-ignoreDo not filter ignored errors from the results.--no-ignore### Errors

[](#errors)

Signature: `php artisan translations:errors locales?* --no-ignore`

List any errors present in the specified locales.

ArgumentRequiredDescriptionExample Valueslocales✗The locales you want to ensure are valid.de, en, es, frOptionsDescriptionExample Valuesno-ignoreDo not filter ignored errors from the results.--no-ignore### Clean

[](#clean)

Signature: `php artisan translations:clean locales?*`

Clean the dead translations -- errors with the message 'no\_reference\_translation' -- from the specified locales.

ArgumentRequiredDescriptionExample Valueslocales✗The locales of the translations to be cleaned.de, en, es, fr### Ignore

[](#ignore)

Signature: `php artisan translations:ignore locale file key?`

Ignore a translations error. Omitting the key argument from the command will ignore all errors from the file. Ignoring an error allows the Validate command to pass if there are errors you do not wish to address.

ArgumentRequiredDescriptionExample Valueslocale✓The locale of the translations to be ignored.de, en, es, frfile✓The file of the translation to be ignored. This should be specified as the path from the base of the locale's lang folder.path/to/filekey✗The key to be ignored in [dot notation](https://laravel.com/docs/7.x/helpers#method-array-dot).keys.to.translation### Unignore

[](#unignore)

Signature: `php artisan translations:unignore locale file key?`

Unignore a translations error. Omitting the key argument from the command will unignore all errors from the file.

ArgumentRequiredDescriptionExample Valueslocale✓The locale of the translations to be unignored.de, en, es, frfile✓The file of the translation to be unignored. This should be specified as the path from the base of the locale's lang folder.path/to/filekey✗The key to be unignored in [dot notation](https://laravel.com/docs/7.x/helpers#method-array-dot).keys.to.translation### Generate Fixes

[](#generate-fixes)

Signature: `php artisan translations:generate-fixes locales?*`

Generate fix files for the locales specified. If no locales are provided, all supported locales will have fix files generated. Fix files are generated to the configured `fixes_dir`.

ArgumentRequiredDescriptionExample Valueslocales✗The locales you want to generate fix files for.de, en, es, fr### Fix

[](#fix)

Signature: `php artisan translations:fix locales?*`

Fix the specified locales using the fix files. If no locales are provided, all supported locales will be fixed. The comand looks for the fix files in the the configured `fixed_dir`.

ArgumentRequiredDescriptionExample Valueslocales✗The locales you want to be fix using the fix files.de, en, es, fr### Status

[](#status)

Signature: `php artisan translations:status locales?*`

Get a complete listing of the status of the translations manager. The status shows the state of every translation file's error and ignore information for every local specified. If no locales are provided, all supported locales will have their status listed.

ArgumentRequiredDescriptionExample Valueslocales✗The locales you want included in the status.de, en, es, frTesting
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Kurt Friars](https://github.com/kfriars)
- [All Contributors](../../contributors)

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

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

3

Last Release

2089d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3378675?v=4)[Kurt](/maintainers/kfriars)[@kfriars](https://github.com/kfriars)

---

Top Contributors

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

---

Tags

kfriarslaravel-translations-manager

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kfriars-laravel-translations-manager/health.svg)

```
[![Health](https://phpackages.com/badges/kfriars-laravel-translations-manager/health.svg)](https://phpackages.com/packages/kfriars-laravel-translations-manager)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[illuminate/translation

The Illuminate Translation package.

6938.0M572](/packages/illuminate-translation)

PHPackages © 2026

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