PHPackages                             anastalal/laravel-translation-importer - 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. anastalal/laravel-translation-importer

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

anastalal/laravel-translation-importer
======================================

A Laravel Package to synchronise translation keys. This package simplifies the process of maintaining translations, especially when new keys are introduced during development.

1.0.0(1y ago)551MITPHPPHP ^8.2

Since Oct 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/anastalal/laravel-translation-importer)[ Packagist](https://packagist.org/packages/anastalal/laravel-translation-importer)[ RSS](/packages/anastalal-laravel-translation-importer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Translation Importer
============================

[](#laravel-translation-importer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a26482fcc681e884b456053a57bc5d1689e3ebef51a62e5d9cb82b02b548c271/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e617374616c616c2f6c61726176656c2d7472616e736c6174696f6e2d696d706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anastalal/laravel-translation-importer)[![Total Downloads](https://camo.githubusercontent.com/e2c4a2ba548a94fce9be1e02ae04fdbf5c652b869d409054a8f54c5e14b8279b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e617374616c616c2f6c61726176656c2d7472616e736c6174696f6e2d696d706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anastalal/laravel-translation-importer)

Introduction
------------

[](#introduction)

The **Laravel Translation Importer** package is a simple and powerful solution to manage your Laravel application's translation keys efficiently. It scans your project for translation functions (`__()` and `trans()`) and automatically updates the translation files located in the `resources/lang` directory.

This package simplifies the process of maintaining translations, especially when new keys are introduced during development. It helps you avoid missing translation keys by automating the synchronization between your project and language files.

Features
--------

[](#features)

- **Manual scanning**: The package provides commands to scan your project for translation keys inside `__()` and `trans()` functions. You can run these commands to update your translation files as needed.
- **File generation**: It generates and updates translation files in `resources/lang`.
- **CLI Commands**: Use artisan commands to sync missing keys or update existing ones.
- **Supports Multiple Languages**: The package is compatible with multi-language projects and works seamlessly across different locales.

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

[](#installation)

You can install the package via composer:

```
composer require anastalal/laravel-translation-importer
```

After installing, you need to publish the configuration file using:

```
php artisan vendor:publish --provider="Anastalal\LaravelTranslationImporter\TranslationImporterServiceProvider"
```

Usage
-----

[](#usage)

> **Important Note**: Before using the package, you must manually create the necessary language folders and files in the `resources/lang` directory. For example:

```
resources/lang/
 ├── en/
 │ └── messages.php
 ├── ar/
 │ └── messages.php
 ├── en.json
 └── ar.json
```

You need to ensure that directories and files for the languages that you want are in place, as the package does not generate them automatically.

### Sync Missing Translation Keys

[](#sync-missing-translation-keys)

The following command scans your project files for any missing translation keys and adds them to the respective language files in the resources/lang folder:

```
php artisan translation-importer:sync-missing-translation-keys
```

Sync Translations
-----------------

[](#sync-translations)

To ensure that all translations are up-to-date, use the sync command. This will compare existing translations and update them as needed:

```
php artisan translation-importer:sync-translations
```

Configuration
-------------

[](#configuration)

Once you’ve published the configuration, you can customize the package’s behavior by modifying the config file located at:

```
config/translation-importer.php
```

Testing
-------

[](#testing)

To ensure the package works as expected, you can run the following tests:

```
composer test
```

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

[](#contributing)

Contributions are welcome!

License
-------

[](#license)

The Laravel Translation Importer is open-sourced software licensed under the [MIT license](LICENSE.md).

Acknowledgments
---------------

[](#acknowledgments)

- [joedixon/laravel-translation](https://github.com/joedixon/laravel-translation)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

583d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/163d9263b9d61588ec623a8db26f56005024e4335c30302da2638a6b8143c142?d=identicon)[anastalal](/maintainers/anastalal)

---

Top Contributors

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

---

Tags

laravellaravel-frameworkmultlanguagepackagetranslationlaravellaravel 11translationimporterlaravel-translationsynchronise-translationssynchronization-translationspackage laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anastalal-laravel-translation-importer/health.svg)

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

###  Alternatives

[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)

PHPackages © 2026

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