Download the PHP package smmahfujurrahman/localization without Composer
On this page you can find all versions of the php package smmahfujurrahman/localization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smmahfujurrahman/localization
More information about smmahfujurrahman/localization
Files in smmahfujurrahman/localization
Package localization
Short Description A Laravel package providing Artisan commands to extract, auto-translate, wrap, and sort Blade translation strings with Google Translate support.
License MIT
Homepage https://github.com/MahfujuRahman/localization
Informations about the package localization
Localization for Laravel
A Laravel package that provides three Artisan commands to fully automate your translation workflow:
| Command | What it does |
|---|---|
localization:extract |
Scans all Blade files for __() / @lang() calls and extracts keys to a JSON file. Optionally auto-translates via Google Translate. |
localization:wrap |
Scans all Blade files and wraps un-translated static text with __() automatically. |
localization:sort |
Sorts any translation JSON file alphabetically by key. |
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Internet connection (for
localization:extractwith a target language)
Installation
Laravel auto-discovers the service provider. No manual registration needed.
Publish Configuration (Recommended)
This creates config/localization.php where you can customise all paths and settings:
Usage
localization:extract — Extract & Auto-Translate
Scan all Blade views and extract every __('...') and @lang('...') key into a JSON file.
Smart re-run: If a target language file already exists, keys that already have a translation are preserved — only new/missing keys are translated. You can re-run safely without overwriting manual edits.
localization:wrap — Wrap Un-Translated Text
Automatically find static English text in your Blade files and wrap it with __().
A timestamped backup of your views directory is created automatically before any files are modified.
Handles 21 patterns including:
- Simple tag text:
<p>Dashboard</p>→<p>{{ __('Dashboard') }}</p> - Dynamic variables:
<span>{{ $type }} Management</span>→<span>{{ __(':type Management', ['type' => $type]) }}</span> - HTML attributes:
placeholder,title,alt,label - Fallback values:
{{ $var ?? 'Default' }}→{{ $var ?? __('Default') }} - Button text, long paragraphs, emoji text, and more
localization:sort — Sort a Translation File
Sort any JSON translation file alphabetically by key for easier management.
Typical Workflow
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributor
Support
For support and questions:
- 📧 Email: [email protected]
All versions of localization with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
stichoza/google-translate-php Version ^5.0