Find missing, unused, and incomplete Laravel translation keys directly inside VS Code.
Laravel Lang Doctor scans your workspace, reads resources/lang, and gives you a local audit of translation issues before they become visible production bugs.
Features
- Detect static Laravel translation calls in
.php,.blade.php,.vue,.js, and.tsfiles. - Read JSON translations such as
resources/lang/en.json. - Read simple grouped PHP arrays such as
resources/lang/fr/messages.php. - Report translation keys used in code but missing from every locale.
- Report keys present in one locale but missing in another.
- Report translation definitions that are never used.
- Create missing keys from the VS Code TreeView.
- Export Markdown and CSV reports.
- Run fully locally with no backend and no telemetry.
Supported Patterns
Laravel Lang Doctor currently detects static string keys in:
__("messages.welcome")
trans("messages.welcome")
@lang("messages.welcome")
{{ __("messages.welcome") }}
Dynamic keys are intentionally ignored because they cannot be resolved safely with a static scan.
Usage
- Open a Laravel project in VS Code.
- Run
Laravel Lang Doctor: Run Auditfrom the Command Palette. - Open the
Laravel Lang Doctorpanel in the Explorer. - Review missing keys, incomplete locales, and unused definitions.
Commands
Laravel Lang Doctor: Run AuditLaravel Lang Doctor: Audit TranslationsLaravel Lang Doctor: Create Missing KeyLaravel Lang Doctor: Export Markdown ReportLaravel Lang Doctor: Export CSV Report
Create Missing Keys
After running an audit, right-click a missing key or locale gap and choose Create Missing Key.
The extension can create entries in:
- JSON locale files, for example
resources/lang/fr.json - grouped PHP array files, for example
resources/lang/fr/messages.php
For PHP array fixes, a dotted key such as messages.welcome is written to messages.php as the key welcome.
Requirements
- VS Code
1.88.0or newer. - A trusted workspace, because the extension reads and can update local translation files.
- A Laravel-style
resources/langdirectory.
Privacy
Laravel Lang Doctor runs locally. It does not send project files, translation keys, reports, or telemetry to any server.
Limitations
- Only static string keys are detected.
- Dynamic keys such as
__("messages." . $status)are ignored. - The PHP parser is designed for simple Laravel translation arrays.
- Auto-fix writes simple JSON objects and PHP arrays; review generated values before committing.
Feedback
Open issues and feature requests on GitHub: