fidum/laravel-translation-linter
A Laravel package that lints translation files for missing, unused, duplicate, and inconsistent keys across locales, plus common syntax issues. It helps keep language files clean, complete, and in sync, and can run via Artisan or CI to catch translation problems before release.
Install via Composer as a dev dependency: composer require fidum/laravel-translation-linter --dev. Publish the configuration file: php artisan vendor:publish --tag="translation-linter-config". The config (config/translation-linter.php) controls which paths are scanned and which translation files are checked. Run the linter with php artisan translation:linter. It scans your application for translation keys used in code (Blade, PHP, etc.) and compares them against your translation files, reporting missing and/or unused keys depending on configuration. First use case: run it locally before committing to catch missing translations early. For Laravel 13 support, ensure you are on v3.0.1 or later.
php artisan translation:linter as a step in your pipeline (e.g., GitHub Actions, GitLab CI) to fail builds when translations are missing. Check the command options (e.g., --fail-on-missing) to enforce strictness.locales in the config to check all supported languages. Use paths to include your app, resources, and any custom packages.__('messages.' . $type)), add those patterns to the ignore list in the config to reduce false positives.parsers config key).ignore config to exclude specific keys or patterns (e.g., messages.*).@lang, @choice, or {{ __('...') }} are detected, but keys in @php blocks or concatenated strings may be missed. Review the linter’s output carefully.app, resources, and routes. If you have translations used in other directories (e.g., packages), add them to paths.-v or --verbose to see which files are being scanned and which keys are detected. This helps trace why a key is reported as missing or unused.checkers array. Refer to the source for advanced customization (e.g., adding a checker for a custom translation loading mechanism).How can I help you explore Laravel packages today?