Laravel Translation Audit
Laravel Translation Audit is an open-source package that finds the missing translations in your Laravel app and removes the unused ones.
Laravel Translation Audit: find missing and unused translations in your Laravel app
Laravel Translation Audit is an open-source package for Laravel applications, built to make it easy to check for missing and orphaned translations in projects with a multilingual UI. It scans PHP files and Blade views for the translation keys in use, compares them against the files in the lang folder, and reports what's missing and what's no longer used. On request, it also removes the unneeded translations.
Installation
You can install it via Composer as a dev dependency:
composer require --dev simonecerruti/laravel-translation-auditNo setup required: it works out of the box with the default configuration. To customize it, you can publish the config file:
php artisan vendor:publish --tag="laravel-translation-audit-config"Commands
php artisan translation:auditScans the codebase (following the paths set in the config or in the command flags) for translation keys, meaning any string passed to Laravel's translation helpers, such as __(), trans(), trans_choice(), @lang, Lang::get(), etc., with support for custom helpers too. It then checks the translation files in lang (or resources/lang) and verifies that every key found is present. If a key isn't found, it's reported as missing for the locales whose files don't contain it, grouped by the source file where it's used.
Passing --unused, you can also find orphaned translations, meaning translations present in the translation files but not used anywhere in the code. Laravel's own translation files (auth.php, pagination.php, passwords.php, validation.php) are excluded by default.
php artisan translation:purge-unusedRemoves all orphaned translations from the files in lang in one go. With --dry-run you can preview what would be removed, without modifying any file:
php artisan translation:purge-unused --dry-runRemoval is conservative: in PHP files only the lines of the unused translations are removed (leaving comments and computed values untouched), while JSON files keep their indentation. Translations that can't be removed safely are left in place and reported along with the reason.
Output, CI and AI agents
Output formats: the result can be printed as
list,tableorjsonvia--display-format, and saved to a file with--save.
CI/CD integration: the command returns a non-zero exit code when it finds issues, so it can block a pull request. The package ships ready-made workflows for GitHub Actions and GitLab CI, which you can publish withvendor:publish.AI agents: when run by Claude Code, Codex, Cursor, Gemini CLI or GitHub Copilot, it detects this automatically and
prints only the JSON, which the agent can easily parse (you can force this with
--for-agent).
Advanced configuration
To also cover cases where keys aren't written literally in the code, the package provides:
Custom translation helpers (translation_calls): your own functions and static methods, even when the key isn't the first argument.
Dynamic keys: keys like
__("payments.{$method}")are read as the patternpayments.*, and you can list their possible values (including via a backed enum) withdynamic_keys.Additional keys (
additional_keys): for keys used only by the frontend or read from the database.Custom resolvers: classes that return keys generated at runtime by logic that can't be analyzed statically.
Granular exclusions: paths, locales and keys to ignore, optionally limited to just the missing or the orphaned check.
Hooks: code that runs before or after the commands, for example to sync translations from an external service or notify your team on Slack.
Open source and license
Laravel Translation Audit is released under the MIT license. Source code, full documentation and changelog are available on GitHub, and the package is published on Packagist.
Gallery
Liked what you saw?
Let's build something together.