Search by

redot / laravel-lang-extractor

AbdelrhmanSaid

A Laravel package to extract language keys from your project files and generate a language file from them.

Package info

github.com/redot-src/laravel-lang-extractor

pkg:composer/redot/laravel-lang-extractor

Statistics

Installs: 7 026

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

v1.1.1 2026-09-15 01:26 UTC

This package is auto-updated.

Last update: 2026-09-15 01:26:53 UTC


README

Laravel Lang Extractor is a tool to extract translation keys from blade files and generate a new language file.

Installation

Installation of this package is done through composer.

composer require --dev redot/laravel-lang-extractor

Usage

To extract translation keys from blade files and generate a new language file, run the following command:

php artisan lang:extract {language}

The extractor scans app, resources, routes, database/seeders, and public/assets for PHP and JavaScript files. It recognizes literal strings passed to __(), trans(), trans_choice(), Lang::get(), Lang::choice(), @lang, and @choice.

Single-quoted and double-quoted strings, heredocs, nowdocs, named arguments, and concatenated string literals are supported. Dynamic or interpolated keys are skipped because they cannot be resolved statically. Keys belonging to PHP language-file groups, such as validation.required, are also skipped.