PHPackages                             ahmedessam/laravel-autotranslate - 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. ahmedessam/laravel-autotranslate

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

ahmedessam/laravel-autotranslate
================================

Laravel AutoTranslate is a package that automates the process of collecting translation keys throughout your Laravel project and organizing them into the appropriate translation files. This tool simplifies multilingual development by ensuring that all translation keys are efficiently managed and up-to-date.

v1.3.0(1y ago)1150MITPHPPHP ^8.2

Since Aug 29Pushed 1y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Laravel AutoTranslate
=====================

[](#laravel-autotranslate)

**Laravel AutoTranslate** is a package that automates the process of collecting translation keys throughout your Laravel project and organizing them into the appropriate translation files. This tool simplifies multilingual development by ensuring that all translation keys are efficiently managed and up-to-date.

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

[](#installation)

You can install the package via Composer:

```
composer require ahmedessam/laravel-autotranslate
```

Usage
=====

[](#usage)

Step 1: Publish Translation Files
---------------------------------

[](#step-1-publish-translation-files)

Before running the AutoTranslate command, you must publish the translation files using Laravel's built-in command:

```
php artisan lang:publish
```

This will create the necessary language files in your lang directory.

Step 2: Synchronize Translation Keys
------------------------------------

[](#step-2-synchronize-translation-keys)

Once the translation files are published, you can run the AutoTranslate command to automatically collect and organize translation keys:

```
php artisan sync:translations
```

This command will scan your entire Laravel project for translation keys and ensure they are properly placed in the corresponding translation files.

Configuration
=============

[](#configuration)

The AutoTranslate package provides a configuration file that allows you to customize the behavior of the translation synchronization process. You can publish the configuration file using the following command:

```
php artisan vendor:publish --tag=autotranslate-config
```

This will create a config file named `autotranslate.php` in your `config` directory. The configuration file contains the following options:

- **reset\_patterns**: If set to true, only your extra patterns will be used. If set to false, both the default and extra patterns will be used.
- **patterns**: An array of extra patterns to search for translation keys in PHP files. You can add your own patterns to capture translation keys in different formats.

Custom Patterns
===============

[](#custom-patterns)

You can define custom patterns to search for translation keys in PHP files. To add a custom pattern, simply add it to the `patterns` array in the `autotranslate.php` configuration file. Each pattern should be a regular expression that captures the translation key.

Here is an example of adding a custom pattern to capture translation keys in the format `trans('key')`:

```
'patterns' => [
    '/trans\([\'\"](.*?)[\'\"]\)/',
],
```

This pattern will capture translation keys in the format `trans('key')` and extract the key value.

Custom Directories
==================

[](#custom-directories)

By default, the AutoTranslate package scans the default Laravel directories for translation keys. If you have additional directories that contain translation keys, you can specify them in the `directories` array in the `autotranslate.php` configuration file.

Here is an example of adding a custom directory to search for translation keys:

```
'directories' => [
    'custom_directory',
],
```

This will include the `custom_directory` in the search for translation keys and remove the default Laravel directories.

Directories to save translations
================================

[](#directories-to-save-translations)

By default, the AutoTranslate package saves the translation keys in the `resources/lang` directory. If you want to save the translation keys in a different directory, you can specify the directory in the `default_directory` option in the `autotranslate.php` configuration file.

Here is an example of saving the translation keys in a custom directory named `custom_lang`:

```
'default_directory' => 'custom_lang',
```

This will save the translation keys in the `custom_lang` directory instead of the default `lang` directory.

Features
========

[](#features)

Translation Key Extraction
--------------------------

[](#translation-key-extraction)

The AutoTranslate package scans your Laravel project for translation keys and extracts them from various sources, including:

- Blade templates
- PHP files

The package identifies translation keys based on the Laravel `__()`, `trans()` helper functions and Blade `@lang` directive.

Requirements
============

[](#requirements)

- PHP 8.2 or higher
- Laravel 10.0 or higher
- Composer

License
=======

[](#license)

The Laravel AutoTranslate package is open-sourced software licensed under the MIT license.

Author
------

[](#author)

- **Ahmed Essam**
    - [GitHub Profile](https://github.com/aahmedessam30)
    - [Packagist](https://packagist.org/packages/ahmedessam/laravel-autotranslate)
    - [LinkedIn](https://www.linkedin.com/in/aahmedessam30/)
    - [Email](mailto:aahmedessam30@gmail.com)

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Issues
------

[](#issues)

If you find any issues with the package or have any questions, please feel free to open an issue on the GitHub repository.

Enjoy building your multilingual applications with Laravel AutoTranslate!

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance40

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

5

Last Release

507d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14383efd445985cf037e39f51ce0228eab1800ddf41cd845457daae1bcd8c192?d=identicon)[aahmedessam30](/maintainers/aahmedessam30)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/ahmedessam-laravel-autotranslate/health.svg)

```
[![Health](https://phpackages.com/badges/ahmedessam-laravel-autotranslate/health.svg)](https://phpackages.com/packages/ahmedessam-laravel-autotranslate)
```

###  Alternatives

[illuminate/translation

The Illuminate Translation package.

6937.4M556](/packages/illuminate-translation)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4821.5k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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