PHPackages                             iivanov2/laravel-translation-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. iivanov2/laravel-translation-manager

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

iivanov2/laravel-translation-manager
====================================

Manage Laravel Translations

0158↓100%PHP

Since Nov 27Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Translation Manager
---------------------------

[](#laravel-translation-manager)

For Laravel 5 and 6.

This is a package to manage Laravel translation files. It does not replace the Translation system, only import/export the php files to a database and make them editable through a webinterface. The workflow would be:

```
- Import translations: Read all translation files and save them in the database
- Find all translations in php/blade/twig sources
- Translate all keys through the webinterface
- Export: Write all translations back to the translation files.

```

This way, translations can be saved in git history and no overhead is introduced in production.

This package is modification of the original project of Barry vd. Heuvel

The main modification is a feature for searching in all keys and translations by string. Also, some features from original package are being removed - adding/removing locales and groups.

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

[](#installation)

Require this package in your composer.json and run composer update (or run `composer require iivanov2/laravel-translation-manager` directly):

```
composer require iivanov2/laravel-translation-manager

```

After including the package, your application will be able to discover the service provider automatically but if doesn't add it to the providers array in `config/app.php` manually

```
'Iivanov2\TranslationManager\ManagerServiceProvider',

```

You need to run the migrations for this package.

```
$ php artisan vendor:publish --provider="Iivanov2\TranslationManager\ManagerServiceProvider" --tag=migrations
$ php artisan migrate

```

You need to publish the config file for this package. This will add the file `config/translation-manager.php`, where you can configure this package.

```
$ php artisan vendor:publish --provider="Iivanov2\TranslationManager\ManagerServiceProvider" --tag=config

```

In order to translate the package in additional languages, you need to publish lang files. They will then be placed in `resources/lang/{locale}/translation_manager.php`.

```
$ php artisan vendor:publish --provider="Iivanov2\TranslationManager\ManagerServiceProvider" --tag=lang

```

In order to edit the default templates, the views must be published as well. The views will then be placed in `resources/views/vendor/translation-manager`.

```
$ php artisan vendor:publish --provider="Iivanov2\TranslationManager\ManagerServiceProvider" --tag=views

```

Routes are added in the ServiceProvider. You can set the group parameters for the routes in the configuration. You can change the prefix or filter/middleware for the routes. If you want full customisation, you can extend the ServiceProvider and override the `map()` function.

This example will make the translation manager available at `http://yourdomain.com/translations`

### Laravel &gt;= 5.2

[](#laravel--52)

The configuration file by default only includes the `auth` middleware, but the latests changes in Laravel 5.2 makes it that session variables are only accessible when your route includes the `web` middleware. In order to make this package work on Laravel 5.2, you will have to change the route/middleware setting from the default

```
    'route' => [
        'prefix' => 'translations',
        'middleware' => 'auth',
    ],

```

to

```
    'route' => [
        'prefix' => 'translations',
        'middleware' => [
	        'web',
	        'auth',
		],
    ],

```

**NOTE:** *This is only needed in Laravel 5.2 (and up!)*

Usage
-----

[](#usage)

### Web interface

[](#web-interface)

When you have imported your translation (via buttons or command), you can view them in the webinterface (on the url you defined with the controller). You can click on a translation and an edit field will popup. Just click save and it is saved :) When a translation is not yet created in a different locale, you can also just edit it to create it.

Using the buttons on the webinterface, you can import/export the translations. For publishing translations, make sure your application can write to the language directory.

You can also use the commands below.

### Import command

[](#import-command)

The import command will search through app/lang and load all strings in the database, so you can easily manage them.

```
$ php artisan translations:import

```

Translation strings from app/lang/locale.json files will be imported to the \_*json* group.

Note: By default, only new strings are added. Translations already in the DB are kept the same. If you want to replace all values with the ones from the files, add the `--replace` (or `-R`) option: `php artisan translations:import --replace`

### Find translations in source

[](#find-translations-in-source)

The Find command/button will look search for all php/twig files in the app directory, to see if they contain translation functions, and will try to extract the group/item names. The found keys will be added to the database, so they can be easily translated. This can be done through the webinterface, or via an Artisan command.

```
$ php artisan translations:find

```

If your project uses translation strings as keys, these will be stored into then \_*json* group.

### Export command

[](#export-command)

The export command will write the contents of the database back to app/lang php files. This will overwrite existing translations and remove all comments, so make sure to backup your data before using. Supply the group name to define which groups you want to publish.

```
$ php artisan translations:export

```

For example, `php artisan translations:export reminders` when you have 2 locales (en/nl), will write to `app/lang/en/reminders.php` and `app/lang/nl/reminders.php`

To export translation strings as keys to JSON files , use the `--json` (or `-J`) option: `php artisan translations:export --json`. This will import every entries from the \_*json* group.

### Clean command

[](#clean-command)

The clean command will search for all translation that are NULL and delete them, so your interface is a bit cleaner. Note: empty translations are never exported.

```
$ php artisan translations:clean

```

### Reset command

[](#reset-command)

The reset command simply clears all translation in the database, so you can start fresh (by a new import). Make sure to export your work if needed before doing this.

```
$ php artisan translations:reset

```

### Detect missing translations

[](#detect-missing-translations)

Most translations can be found by using the Find command (see above), but in case you have dynamic keys (variables/automatic forms etc), it can be helpful to 'listen' to the missing translations. To detect missing translations, we can swap the Laravel TranslationServiceProvider with a custom provider. In your `config/app.php`, comment out the original TranslationServiceProvider and add the one from this package:

```
//'Illuminate\Translation\TranslationServiceProvider',
'Barryvdh\TranslationManager\TranslationServiceProvider',

```

This will extend the Translator and will create a new database entry, whenever a key is not found, so you have to visit the pages that use them. This way it shows up in the webinterface and can be edited and later exported. You shouldn't use this in production, just in development to translate your views, then just switch back.

###  Health Score

19

—

LowBetter than 11% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 59.1% 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://www.gravatar.com/avatar/3afc379f994852eed975346927fea56ac4792b8cd6c8d118b3885ca834904007?d=identicon)[iivanov2](/maintainers/iivanov2)

---

Top Contributors

[![iskrenivanov](https://avatars.githubusercontent.com/u/26455774?v=4)](https://github.com/iskrenivanov "iskrenivanov (13 commits)")[![iivanov2](https://avatars.githubusercontent.com/u/9646935?v=4)](https://github.com/iivanov2 "iivanov2 (9 commits)")

### Embed Badge

![Health badge](/badges/iivanov2-laravel-translation-manager/health.svg)

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

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k822.3M1.8k](/packages/symfony-translation)[commerceguys/addressing

Addressing library powered by CLDR and Google's address data.

95229.5M35](/packages/commerceguys-addressing)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

170648.9M4.3k](/packages/nesbot-carbon)[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.5M16](/packages/barryvdh-laravel-translation-manager)[a2lix/translation-form-bundle

Translate your doctrine objects easily with some helpers

3436.9M38](/packages/a2lix-translation-form-bundle)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

716892.4k8](/packages/joedixon-laravel-translation)

PHPackages © 2026

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