sertxudeveloper / laravel-translations-checker
Check Laravel translation files for missing keys, files, and empty values. Integrates with CI/CD pipelines.
Package info
github.com/sertxudeveloper/laravel-translations-checker
pkg:composer/sertxudeveloper/laravel-translations-checker
Requires
- php: ^8.2 || ^8.3 || ^8.4 || ^8.5
- illuminate/contracts: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- laravel/pint: ^1.14
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^2.1
README
Laravel Translations Checker
Check Laravel translation files for missing translations. Based on the package LarsWiegers/laravel-translations-checker.
This package scans your Laravel translation files and reports:
- Missing translation files across languages
- Translation keys that exist in one language but not others
- Empty or blank translation values
Requirements
This package requires PHP 8.2+ and Laravel 11.0+.
Installation
You can install the package via composer:
composer require sertxudeveloper/laravel-translations-checker
Usage
Run the check command to scan your translation files:
php artisan translations:check
By default, it checks the lang directory in your application. You can specify a different directory:
php artisan translations:check --directory=resources/lang
The command returns exit code 1 if any issues are found, making it suitable for CI/CD pipelines.
Example output
Missing translations:
- The language es (resources/lang/es) is missing the file (auth.php)
- es.validation.required
Empty translations:
- en.messages.welcome (empty value)
Using the Service
You can also use the underlying service in your own code:
use SertxuDeveloper\TranslationsChecker\Services\TranslationCheckerService; $checker = app(TranslationCheckerService::class); $result = $checker->check(resource_path('lang')); $result['missingFiles']; // Files missing in some languages $result['missingTranslations']; // Keys missing in some languages $result['emptyTranslations']; // Keys with empty values
Testing
This package contains tests. Run them using:
composer test
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Sergio Peris
- Special mention to LarsWiegers
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Copyright © 2026 Sertxu Developer
