Download the PHP package mohammadtrabelsi/laravel-translation-sync without Composer
On this page you can find all versions of the php package mohammadtrabelsi/laravel-translation-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mohammadtrabelsi/laravel-translation-sync
More information about mohammadtrabelsi/laravel-translation-sync
Files in mohammadtrabelsi/laravel-translation-sync
Package laravel-translation-sync
Short Description Scan your Laravel app (views, Livewire components, services and laravel-modules) for translation keys and sync them across every locale with a single artisan command.
License MIT
Informations about the package laravel-translation-sync
Laravel Translation Sync
Scan your entire Laravel application for translation keys and keep every locale in sync with a single artisan command.
It walks your resources/, Livewire component classes and blade views,
app/Services, and every module under a
laravel-modules Modules/ tree,
extracts every key used with __(), trans(), @lang() or trans_choice(),
creates any missing lang/{locale}/*.php files, and adds the missing keys to
every locale so nothing is left untranslated.
Requirements
- PHP
^8.2 - Laravel 11, 12 or 13
Installation
The service provider is auto-discovered, so there is nothing else to register.
Usage
Options
| Option | Description |
|---|---|
--locales=en,fr,ar |
Comma-separated locales to sync. Defaults to auto-detecting the lang/ sub-directories. |
--base=en |
The reference locale used as the source of truth (default en). |
--dry-run |
Show what would change without writing any files. |
--clean |
Also remove keys from lang files that no longer appear in the code. |
Examples
How keys are grouped
Keys are grouped by their file prefix:
__('auth.failed')→lang/{locale}/auth.phpunder thefailedkey.__('Hello world')(a plain string with no group) →lang/{locale}/strings.php.
For the base locale a missing key gets a human-friendly placeholder derived from
the key itself (welcome_back → Welcome back). For other locales the missing
value is prefixed with [TODO] and seeded from the base translation so you can
easily find what still needs translating.
License
The MIT License (MIT). See LICENSE.
All versions of laravel-translation-sync with dependencies
illuminate/console Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0