simonecerruti / laravel-translation-audit
Audit your app for missing or unused translations.
Package info
github.com/SimoneCerruti/laravel-translation-audit
pkg:composer/simonecerruti/laravel-translation-audit
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/support: ^12.0||^13.0
- nikic/php-parser: ^5.9
- symfony/finder: ^7.4.19||^8.1.7
- thecodingmachine/safe: ^3.4
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.6||^5.0
- pestphp/pest-plugin-laravel: ^4.1||^5.0
- pestphp/pest-plugin-phpstan: ^5.2
- pestphp/pest-plugin-rector: ^5.0
- pestphp/pest-plugin-type-coverage: ^4.0||^5.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- rector/rector: ^2.6
- thecodingmachine/phpstan-safe-rule: ^1.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel Translation Audit
Audit your app for missing or unused translations.
Laravel Translation Audit scans your PHP files and Blade views for translation calls such as __(), trans(), trans_choice(), @lang, and Lang::get(). It then checks that every key it finds has a translation in each of your app's locales. The locales are detected automatically from your lang folder, or you can list them in the config file.
Installation
You can install the package via Composer:
composer require simonecerruti/laravel-translation-audit
You may publish all of the package's resources at once:
php artisan vendor:publish --tag="laravel-translation-audit"
Or, you may publish each resource individually:
Publishing the Configuration File
php artisan vendor:publish --tag="laravel-translation-audit-config"
Publishing the GitHub Workflow
php artisan vendor:publish --tag="laravel-translation-audit-workflow"
The workflow is published to .github/workflows/audit-translations.yml and runs the audit on every push to main and on every pull request.
Usage
php artisan translation:audit
The command exits with a non-zero status code when it finds missing translations, so it can be used to fail a CI pipeline.
Symbolic links are not followed by default. Pass --follow-links to scan the files behind them as well:
php artisan translation:audit --follow-links
The links matching the ignore_links glob patterns in the config file, vendor and node_modules by default, are never followed.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Thank you for considering contributing to Laravel Translation Audit! Please review our contributing guide to get started.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
Laravel Translation Audit is open-sourced software licensed under the MIT license.