laravel-lang/status-generator
Dev-only Laravel Lang tool to create missing locales and download/copy translation files from Laravel, framework, Jetstream and more. Includes CLI commands for generating locale stubs, fetching zips by version, and copying lang paths with optional key lookup.
resources/lang, __() helpers, trans_choice), making it a natural fit for Laravel 8.x–13.x projects. It leverages Laravel’s service container, artisan commands, and file structure conventions, reducing architectural friction.lang create, lang status, lang sync, lang translate), aligning with Laravel’s command-line-first philosophy. This avoids bloating the application with monolithic localization logic.addCommand compatibility) mitigate deprecation risks.__(), trans_choice, ternary operators), which is critical for syncing dynamic content. This reduces reliance on manual key management and prevents drift in large codebases.composer require --dev) and does not modify core Laravel files, making it easy to add/remove. It does not require database migrations or configuration changes, reducing integration overhead.- name: Sync translations
run: vendor/bin/lang sync
download command allows fetching translations from upstream repositories (e.g., laravel/framework, laravel/jetstream), making it ideal for ecosystem-wide localization (e.g., open-source projects with shared translations).translate command provides a free-tier API for auto-translation, but it can be disabled or extended with custom providers (e.g., DeepL, AWS Translate) via service provider overrides.__('key') vs. hardcoded strings) may have false positives/negatives in complex PHP templates (e.g., Blade with dynamic keys). Mitigation: Run lang sync --dry-run in CI to validate changes.--only-copy for bulk downloads or cache translations to avoid repeated API calls.{{ __('custom.key') }} in Blade), the parser may miss them. Mitigation: Extend the parser via service binding or custom commands.lang sync in CI, or is this a manual step for translators?jobs:
sync-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer install --dev
- run: vendor/bin/lang sync --dry-run # Validate changes
- run: vendor/bin/lang status # Generate report
download command supports fetching translations from upstream repos (e.g., laravel/framework), making it ideal for open-source projects or multi-package systems.| Current State | Migration Steps | Risks |
|---|---|---|
| No localization system | 1. Install package (composer require --dev laravel-lang/status-generator).2. Initialize locales (vendor/bin/lang create --locale=es).3. Sync keys (vendor/bin/lang sync). |
None. Greenfield adoption. |
| Manual translation files | 1. Install package.2. Run vendor/bin/lang sync to detect missing keys.3. Use vendor/bin/lang status to audit coverage.4. Migrate to automated workflows. |
Key mismatches if manual files don’t align with parsed keys. |
| Crowdin/Transifex | 1. Export all translations from Crowdin/Transifex.2. Place them in resources/lang/.3. Run vendor/bin/lang sync to align keys.4. Use vendor/bin/lang translate for auto-filling gaps. |
Key format differences (e.g., Crowdin’s IDs vs. Laravel’s dot notation). |
| Custom script-based workflow | 1. Replace custom scripts with vendor/bin/lang commands.2. Deprecate old scripts in favor of the package.3. Document new workflows for the team. |
Team resistance to changing tools. |
| Laravel <8.0 | Not recommended. The package requires Laravel 8.x+. Consider upgrading Laravel or using a legacy-compatible fork. | High effort for Laravel upgrades. |
| Component | Compatibility | Notes |
|---|---|---|
| Laravel Framework | 8.x, 9.x, 10.x, 11.x, |
How can I help you explore Laravel packages today?