PHPackages                             tarektaher/artisan-language - 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. [CLI &amp; Console](/categories/cli)
4. /
5. tarektaher/artisan-language

ActiveLibrary[CLI &amp; Console](/categories/cli)

tarektaher/artisan-language
===========================

add artisan commands for language

0.1.1(1y ago)1106MITPHPPHP 8.\*

Since Nov 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tarektaher/artisan-language)[ Packagist](https://packagist.org/packages/tarektaher/artisan-language)[ Docs](https://github.com/tarektaher/artisan-language)[ RSS](/packages/tarektaher-artisan-language/feed)WikiDiscussions main Synced yesterday

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

Artisan Language
================

[](#artisan-language)

[![Latest Version](https://camo.githubusercontent.com/702b25684a85fe2e531f726e45999e363cf34b5593e00fd7fa4f2f1910be2dea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f746172656b74616865722f6172746973616e2d6c616e67756167653f6c6162656c3d6c617465737425323076657273696f6e)](https://github.com/tarektaher/artisan-language/releases)[![License](https://camo.githubusercontent.com/03f62edbf180c2a3cc473d625983f24f974b8926862e75d557e15c53278968e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f746172656b74616865722f6172746973616e2d6c616e6775616765)](https://github.com/tarektaher/artisan-language/blob/main/LICENSE)[![Download](https://camo.githubusercontent.com/86bf1644bd2c9c47715f3a0fce2de3242bfae479ac6493ee44b2c1e60bb5c406/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f776e6c6f61642d4172746973616e2532304c616e67756167652d626c7565)](https://github.com/tarektaher/artisan-language/archive/refs/tags/v1.0.0.zip)

**Artisan Language** is a Laravel package designed to streamline the management of translation keys in your application. It provides powerful Artisan commands to synchronize, scan, and manage translation keys for Blade templates, PHP files, and JavaScript files.

---

**Features**
------------

[](#features)

- Synchronize translation keys across multiple locales.
- Automatically update JSON language files with missing keys.
- Remove unused keys from JSON language files.
- Scan Blade, PHP, and JavaScript files for translation keys.
- Fully customizable through the configuration file.

---

**Installation**
----------------

[](#installation)

Install the package via Composer:

```
composer require tarektaher/artisan-language
```

Publish the configuration file:

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

This will create the configuration file at `config/artisan-language.php`.

---

**Configuration**
-----------------

[](#configuration)

The configuration file allows you to define paths, patterns, and settings for the package.

**Default Configuration:**

```
return [
    'default_language' => 'en', // Default language for synchronization
    'languages' => [ // Supported languages
        'en' => 'English',
        'fr' => 'French',
    ],
    'scan_paths' => [ // Paths to scan for translation keys
        app_path(),
        resource_path('views'),
        resource_path('assets/js'),
    ],
    'scan_pattern' => '/(@lang|__|\$t|\$tc)\s*(\(\s*[\'"])([^$]*)([\'"]+\s*(,[^\)]*)*\))/U', // Regex pattern to detect keys
    'lang_path' => base_path('lang'), // Path to JSON language files
];
```

---

**Commands**
------------

[](#commands)

### **1. Scan for Missing Keys**

[](#1-scan-for-missing-keys)

Scan configured paths (Blade templates, PHP files, JavaScript files) for missing translation keys and update the JSON language files.

```
php artisan lg:scan
```

**Options:**

- `--lang`: Specify the target language (default: configured default language).

**Example:**

```
php artisan lg:scan --lang=fr
```

---

### **2. Synchronize Translation Keys**

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

Synchronize translation keys between the base language and a target locale.

```
php artisan lg:sync {locale}
```

**Arguments:**

- `locale`: The locale to synchronize.

**Options:**

- `--nomissing`: Skip adding missing keys from the base language file.
- `--nofurther`: Skip removing extra keys from the target language file.

**Example:**

```
php artisan lg:sync fr --nomissing
```

---

### **3. Add Translation Keys**

[](#3-add-translation-keys)

Add a new translation key to the specified language file.

```
php artisan lg:add {key} {value} {--lang=en}
```

**Arguments:**

- `key`: The translation key to add.
- `value`: The value for the key.

**Options:**

- `--lang`: Specify the target language (default: `en`).

**Example:**

```
php artisan lg:add welcome "Welcome to our app" --lang=fr
```

---

### **4. Remove Translation Keys**

[](#4-remove-translation-keys)

Remove a translation key from the specified language file.

```
php artisan lg:remove {key} {--lang=}
```

**Arguments:**

- `key`: The translation key to remove.

**Options:**

- `--lang`: Specify the target language.

**Example:**

```
php artisan lg:remove "Your email is invalid" --lang=fr
```

---

**Customization**
-----------------

[](#customization)

You can customize paths, regex patterns, and language file locations in the configuration file (`config/artisan-language.php`).

---

**Download**
------------

[](#download)

You can download the latest release of Artisan Language here:

[![Download Artisan Language](https://camo.githubusercontent.com/86bf1644bd2c9c47715f3a0fce2de3242bfae479ac6493ee44b2c1e60bb5c406/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f776e6c6f61642d4172746973616e2532304c616e67756167652d626c7565)](https://github.com/tarektaher/artisan-language/archive/refs/tags/v1.0.0.zip)

---

**Contributing**
----------------

[](#contributing)

Contributions are welcome! Feel free to fork this repository, submit a pull request, or open an issue on [GitHub](https://github.com/tarektaher/artisan-language/issues).

---

**License**
-----------

[](#license)

This package is open-sourced software licensed under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](https://github.com/tarektaher/artisan-language/blob/main/LICENSE) file for details.

---

**Support**
-----------

[](#support)

For issues or questions, please contact [Tarek Taher](https://github.com/tarektaher) or open a GitHub issue.

With **Artisan Language**, managing translations has never been easier. Start synchronizing and scanning your keys today! 🎉

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

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

Total

2

Last Release

582d ago

PHP version history (2 changes)0.1.0PHP &gt;=8.1

0.1.1PHP 8.\*

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tarektaher-artisan-language/health.svg)

```
[![Health](https://phpackages.com/badges/tarektaher-artisan-language/health.svg)](https://phpackages.com/packages/tarektaher-artisan-language)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[ronasit/laravel-entity-generator

Provided console command for generating entities.

2053.1k](/packages/ronasit-laravel-entity-generator)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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