PHPackages                             glebsky/laravel-lang-generator - 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. glebsky/laravel-lang-generator

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

glebsky/laravel-lang-generator
==============================

Searches for multilingual phrases in Laravel project and automatically generates language files for you.

2.0.0(4y ago)2421.3k↓27.6%7[1 PRs](https://github.com/Glebsky/laravel-lang-generator/pulls)MITPHPPHP ^8.2

Since Dec 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Glebsky/laravel-lang-generator)[ Packagist](https://packagist.org/packages/glebsky/laravel-lang-generator)[ RSS](/packages/glebsky-laravel-lang-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Laravel Lang Generator
======================

[](#laravel-lang-generator)

[![Laravel Lang Generator](https://camo.githubusercontent.com/ccd845c0a13c84073fd2265188494a7a3dca03da74358c1005e159c70208d691/68747470733a2f2f692e696d6775722e636f6d2f53414c77634b662e706e67)](https://camo.githubusercontent.com/ccd845c0a13c84073fd2265188494a7a3dca03da74358c1005e159c70208d691/68747470733a2f2f692e696d6775722e636f6d2f53414c77634b662e706e67)

[![Build Status](https://camo.githubusercontent.com/d8575ec631f293c749404f60330d2c4714f54dc5a9d8da8cf181b177f2d4b174/68747470733a2f2f6170702e7472617669732d63692e636f6d2f476c6562736b792f6c61726176656c2d6c616e672d67656e657261746f722e7376673f6272616e63683d6d61696e)](https://travis-ci.org/glebsky/laravel-lang-generator)[![StyleCI](https://camo.githubusercontent.com/1397498d3b9305bc91292989304fdd08533f1a3ec61ee6bfef8c70cc4856c735/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3434303038393631322f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/440089612)[![Travis](https://camo.githubusercontent.com/28aa2cae90011b0febab11cc3af187f5709e1e286284a37302866316d128b14d/68747470733a2f2f62616467656e2e6e65742f7472617669732f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f72)](https://packagist.org/packages/glebsky/laravel-lang-generator)[![Latest Stable Version](https://camo.githubusercontent.com/bb6e73ff1869eed9eb38fbb91e4392a4e39c48d6e2ea61971de7ed8c659b68c5/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f722f737461626c65)](https://packagist.org/packages/glebsky/laravel-lang-generator)[![PHP Version](https://camo.githubusercontent.com/ab6f61f30f6237ec3cd8ccc74cc71a6a808b8e64fef453b765973d294140ecfc/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f72)](https://packagist.org/packages/glebsky/laravel-lang-generator)[![Tags](https://camo.githubusercontent.com/9249992686bd5ef136adb2efa2bdc7aa1023c7652f3e1160ab593b14827ae67b/68747470733a2f2f62616467656e2e6e65742f6769746875622f746167732f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f72)](https://packagist.org/packages/glebsky/laravel-lang-generator)[![Last tag](https://camo.githubusercontent.com/5f47fb2d123b08de30749582e9c145d0b927663473fba1283f6348e1bb6a9f1e/68747470733a2f2f62616467656e2e6e65742f6769746875622f7461672f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f72)](https://packagist.org/packages/glebsky/laravel-lang-generator)[![Downloads](https://camo.githubusercontent.com/2142a53d0d66bf2f58b60b42d86f7d412422c1fe089d17d31a04597c0e7fd664/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f676c6562736b792f6c61726176656c2d6c616e672d67656e657261746f72)](https://packagist.org/packages/glebsky/laravel-lang-generator)

Searches for multilingual phrases in a Laravel project and automatically generates language files for you. You can search for new translation keys, delete unused keys, and quickly generate new language files.

---

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

[](#installation)

You can start the installation through the **composer** using the command.

```
composer require glebsky/laravel-lang-generator

```

You can also select the required version to support older versions of Laravel

- v2.0.0 - For Laravel 11+. Using PHP &gt;8.2
- v1.1.0 - For Laravel 8 and 9. Using PHP &gt;7.3.

```
composer require glebsky/laravel-lang-generator:^1.1.0

```

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

[](#configuration)

To create configuration file of this package you can use command:

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

```

It will create configuration file in `app/config` with name `lang-generator`

### About configuration

[](#about-configuration)

**file\_type**: is responsible for the type of the generated file. It is possible to generate both a json and a php array files. Possible values: `array` , `json`

---

**file\_name**: is responsible for the name of the generated files. By default, it is `lang`.

---

**languages**: is responsible for the generated languages and accepts an array. Language folders with the specified data will be created. By default, it just `en`.

---

Usage
-----

[](#usage)

### Main Command

[](#main-command)

This command starts searching for translation keys in the `resource/views` and `app` folders according to the basic settings. Existing keys will not be removed, only new ones will be added.

```
php artisan lang:generate

```

it will create new language files with found translation keys. By default, name of lang file is `lang`

[![title](https://camo.githubusercontent.com/82613f48ecbdb94ad1b403c4aa1a4076f50563c64a7527f7ab84fc841da62f61/68747470733a2f2f692e696d6775722e636f6d2f687644726c564f2e6a706567)](https://camo.githubusercontent.com/82613f48ecbdb94ad1b403c4aa1a4076f50563c64a7527f7ab84fc841da62f61/68747470733a2f2f692e696d6775722e636f6d2f687644726c564f2e6a706567)[![title](https://camo.githubusercontent.com/4686378016fee1f9a984cc9f95428eccfa84cbbca839a5645b67137ecc99c029/68747470733a2f2f692e696d6775722e636f6d2f476f6c5a65685a2e706e67)](https://camo.githubusercontent.com/4686378016fee1f9a984cc9f95428eccfa84cbbca839a5645b67137ecc99c029/68747470733a2f2f692e696d6775722e636f6d2f476f6c5a65685a2e706e67)

### Parameters

[](#parameters)

In addition, the command accepts several parameters that allow you to flexibly manage the package.

```
php artisan lang:generate --type= --name= --langs= --sync --clear --append --path=

```

### About parameters

[](#about-parameters)

`--type=` or `-T`:

is responsible for the type of the generated file. It is possible to generate both a json and a php array files. Possible values: `array` , `json`.
Example: `php artisan lang:generate --type=json`

---

`--name=` or `-N`:

is responsible for the name of the generated files. By default, it is `lang`.

Example: `php artisan lang:generate --name="pagination"`

---

`--langs=` or `-L`:

is responsible for the generated languages and accepts an array. Language folders with the specified data will be created. By default, it just `en`.
Example: `php artisan lang:generate --langs="en" --langs="es"`

---

`--sync` or `-S`:

If you specify this flag, then all unused already existing translation keys will be deleted.
Example: `php artisan lang:generate --sync`

---

`--clear` or `-C`:

If you specify this flag, existing language files are removed and new ones are created. All existing translations will be removed.

> NOTE! That NOT all language files are deleted, but only with the name specified in the settings.

Example: `php artisan lang:generate --clear`

---

`--append` or `-A`:

If you specify this flag, new translations found will be added at the end of the JSON file, which might be useful for automation or version control. Only usable with JSON as type.

Example: `php artisan lang:generate --type=json --append`

Notes
-----

[](#notes)

> `lang:generate` will update your language files by writing them completely, meaning that any comments or special styling will be removed, so I recommend you backup your files.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 71.6% 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 ~0 days

Total

4

Last Release

1611d ago

Major Versions

1.1.0 → 2.0.02021-12-20

PHP version history (3 changes)1.0.0PHP ^7.3|^8.0

1.1.0PHP &gt;=7.3

2.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20194253?v=4)[glebsky](/maintainers/glebsky)[@Glebsky](https://github.com/Glebsky)

---

Top Contributors

[![Glebsky](https://avatars.githubusercontent.com/u/20194253?v=4)](https://github.com/Glebsky "Glebsky (48 commits)")[![MerelSollie](https://avatars.githubusercontent.com/u/50244687?v=4)](https://github.com/MerelSollie "MerelSollie (9 commits)")[![antoine-bernier-codems](https://avatars.githubusercontent.com/u/189873141?v=4)](https://github.com/antoine-bernier-codems "antoine-bernier-codems (4 commits)")[![gejobj](https://avatars.githubusercontent.com/u/9005888?v=4)](https://github.com/gejobj "gejobj (3 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (3 commits)")

---

Tags

generatorlanguagelaravellaravel-frameworklaravel-langlaravel-languagelaravel-multi-languagetranslationlaravellanguagetranslationautomatic translation

### Embed Badge

![Health badge](/badges/glebsky-laravel-lang-generator/health.svg)

```
[![Health](https://phpackages.com/badges/glebsky-laravel-lang-generator/health.svg)](https://phpackages.com/packages/glebsky-laravel-lang-generator)
```

###  Alternatives

[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)[badinansoft/nova-language-switch

A Laravel Nova package to switch language in your application

26506.4k1](/packages/badinansoft-nova-language-switch)[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)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)[zachleigh/laravel-lang-bundler

Create Laravel translations bundles.

2512.5k](/packages/zachleigh-laravel-lang-bundler)

PHPackages © 2026

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