PHPackages                             mahmoud217tr/auto-files-localizer - 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. mahmoud217tr/auto-files-localizer

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

mahmoud217tr/auto-files-localizer
=================================

Laravel Localization package that auto generate json locale files

1.1.0(1y ago)147[5 PRs](https://github.com/Mahmoud217TR/auto-files-localizer/pulls)MITPHPPHP ^8.0CI passing

Since Jun 29Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Mahmoud217TR/auto-files-localizer)[ Packagist](https://packagist.org/packages/mahmoud217tr/auto-files-localizer)[ Docs](https://github.com/mahmoud217tr/auto-files-localizer)[ GitHub Sponsors](https://github.com/Mahmoud217TR)[ RSS](/packages/mahmoud217tr-auto-files-localizer/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (18)Versions (8)Used By (0)

Auto Files Localizer for Laravel
================================

[](#auto-files-localizer-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/92f5d45d6b1a22b2780cc596e9d374fa2bbfa4427bcc2652402f415491dbcf60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61686d6f756432313774722f6175746f2d66696c65732d6c6f63616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahmoud217tr/auto-files-localizer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/309354b227be057124c2a6e0449c3c473a94679c369b0ccb2a15cbb90ce2d7c1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61686d6f756432313774722f6175746f2d66696c65732d6c6f63616c697a65722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mahmoud217tr/auto-files-localizer/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f89e35d11319924e7a7ad11aadaa0292baa9ba7c00f78751e381e51e6718f21a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61686d6f756432313774722f6175746f2d66696c65732d6c6f63616c697a65722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mahmoud217tr/auto-files-localizer/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/79b8a6a0aabd3f305aec864aee57cc54f0a30c09614d065d05e87f13e4bc8aab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61686d6f756432313774722f6175746f2d66696c65732d6c6f63616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahmoud217tr/auto-files-localizer)

**Easy and Efficient Localiztion**

A Laravel Localization package that auto generate json locale files

[![logo](assets/auto-files-localizer.svg)](assets/auto-files-localizer.svg)

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Config](#config)
- [Usage](#usage)
    - [Dynamic Mode](#dynamic-mode)
    - [Extraction Mode](#extraction-mode)
- [Testing](#testing)
- [Changelog](#changelog)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

Features
--------

[](#features)

- Supports Laravel (8.X, 9.X, 10.X, 11.X).
- 2 Modes (Dynamic Mode, Extraction Mode).
- Fast and reliable.

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

[](#installation)

You can install the package via composer:

```
composer require mahmoud217tr/auto-files-localizer
```

Config
------

[](#config)

To publish the package configuration file `config/auto-localizer.php` use the following command:

```
php artisan vendor:publish --tag="auto-files-localizer-config"
```

Usage
-----

[](#usage)

It will automatically generate the locale `.json` file where the localized new words are sorted alphabetically.

**There are 2 modes for the package**

### Dynamic Mode

[](#dynamic-mode)

In this mode the translations will be generated dynamically **(On Request)** which means on upon calling the translation function the package will dynamically detect the current language and add the translations to the corresponding `JSON` file.

#### Notes

[](#notes)

- Note that this mode shouldn't work on production for performance purposes, but if you want to change this behavior via the configuration file.
- This mode is not recommended using with `vite development` mode. If you want to use it please **build your assets first** using `npm run build` then activate the auto translation mode. **OTHERWISE YOUR APP WILL STUCK IN RELOAD LOOP**

#### Activiation

[](#activiation)

To activate the `dynamic` mode on `non-production` environment just add the following line to the `.env` file:

```
AUTO_LOCALIZER_ENABLED=true

```

And that's about it the autotranslator will add transaltions to there files sorted alphabetically. To deactivate the dynamic mode just set the previous value to `false`.

#### Configurations

[](#configurations)

This mode have the following configurations:

```
'dynamic' => [
    # Controls if the dynamic mode should work or not on non-production environments
    'enabled' => (bool) env('AUTO_LOCALIZER_ENABLED', false),
    # Controls if the dynamic mode should work or on production environment (compined with the previous option)
    'production' => false,
],
```

### Extraction Mode

[](#extraction-mode)

In this mode the translations will be extracted automatically from `views` or `php` files detecting translation functions adding the translations to the corresponding `JSON` file.

#### Command

[](#command)

To extract the translations for a specific locale (`ar` for example) run the following command:

```
php artisan localizer:extract ar
```

The previous command will translate all `non-localized` phrases and all `ar-localized` phrases only.

#### Configurations

[](#configurations-1)

This mode have the following configurations:

```
'extraction' => [
    # The directories where the translation scanner will scan
    'directories' => [
        'resources/views',
    ],
    # The file patterns that the translation scanner will scan
    'patterns' => [
        '*.php'
    ],
    # The translation functions or directives that scanner will detect (you should add your custom functions here)
    'functions' => [
        '__',
        'trans',
        '@lang',
    ],
],
```

Testing
-------

[](#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 Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mahmoud Mahmoud](https://github.com/Mahmoud217TR)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance60

Regular maintenance activity

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.5% 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 ~26 days

Total

2

Last Release

708d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/54012843?v=4)[Mahmoud Mahmoud (Marlo)](/maintainers/Mahmoud217TR)[@Mahmoud217TR](https://github.com/Mahmoud217TR)

---

Top Contributors

[![Mahmoud217TR](https://avatars.githubusercontent.com/u/54012843?v=4)](https://github.com/Mahmoud217TR "Mahmoud217TR (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

auto-files-localizerjsonlaravellocalizationtranslationlaravelMahmoud217TRauto-files-localizer

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mahmoud217tr-auto-files-localizer/health.svg)

```
[![Health](https://phpackages.com/badges/mahmoud217tr-auto-files-localizer/health.svg)](https://phpackages.com/packages/mahmoud217tr-auto-files-localizer)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M6](/packages/propaganistas-laravel-disposable-email)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[illuminate/queue

The Illuminate Queue package.

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

PHPackages © 2026

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