larswiegers/laravel-translations-checker
Find missing Laravel translations fast. Run php artisan translations:check to compare languages and see what keys are missing and where. Supports custom lang directories plus excluding vendor paths, specific languages, and file extensions for cleaner results.
Architecture fit:
resources/lang), requiring no architectural changes. Supports both PHP and JSON formats, which are standard in Laravel. Zero runtime impact (installed as a dev dependency).Lang::get($dynamicKey)) or custom translation drivers (e.g., database-backed). Assumes standard Laravel file structure, which may not apply to monorepos or non-standard setups.Integration feasibility:
composer require --dev) with optional CLI flags or config overrides. No API or service integration required—purely a validation tool.excluded_directories, exclude_languages). Supports both CLI and config-based exclusions, reducing friction for teams with complex translation hierarchies.Technical risk:
trans('key.'.$dynamicSuffix)). Requires manual review or supplementary tools (e.g., static analysis).app/Translations) may require custom exclusion rules.Key questions:
trans('auth.{{$type}}')) that can be pre-validated?Stack fit:
Migration path:
composer.json as a dev dependency:
composer require --dev larswiegers/laravel-translations-checker
config/translation-checker.php (if using config-based exclusions):
'excluded_directories' => ['lang/vendor', 'custom/path'],
'exclude_languages' => ['en', 'test'],
'excluded_file_extensions' => ['php'], // Keep only JSON
php artisan translations:check --directory=resources/lang
- name: Check translations
run: php artisan translations:check --excludedDirectories=vendor
set +e to allow non-critical warnings or strict mode to block merges.Compatibility:
--directory flag or config.nl: { "key": "partial" }).Sequencing:
Maintenance:
Support:
Scaling:
lang/vendor).Failure modes:
| Scenario | Impact | Mitigation |
|---|---|---|
| Missing translations in prod | User-facing errors | Enforce CI checks; fail-fast for prod languages. |
| False positives (excluded files) | Noise in CI logs | Review exclusions; test with sample data. |
| Dynamic keys not detected | Undetected gaps | Supplement with manual reviews or static analysis. |
| CI timeout | Broken pipeline | Exclude large directories; optimize CI resources. |
| Configuration errors | No output or crashes | Validate config syntax; use CLI flags for testing. |
Ramp-up:
How can I help you explore Laravel packages today?