Download the PHP package kalimeraa/grumphp-laravel-translation-checker without Composer
On this page you can find all versions of the php package kalimeraa/grumphp-laravel-translation-checker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kalimeraa/grumphp-laravel-translation-checker
More information about kalimeraa/grumphp-laravel-translation-checker
Files in kalimeraa/grumphp-laravel-translation-checker
Package grumphp-laravel-translation-checker
Short Description A GrumPHP task that validates Laravel translation files for missing keys, duplicate keys, and synchronization across locales.
License MIT
Homepage https://github.com/kalimeraa/grumphp-laravel-translation-checker
Informations about the package grumphp-laravel-translation-checker
GrumPHP Laravel Translation Checker
A GrumPHP extension that validates Laravel translation files on every commit. Detects missing keys, duplicate keys, and keeps all locale files synchronized.
Features
- Detects missing translation keys across all locales
- Detects duplicate keys within language files (PHP silently overwrites duplicates)
- Supports nested translation keys (dot notation:
password.reset) - Auto-fix mode: automatically adds missing keys from the base language
- Auto-stage mode: stages fixed files for commit
- Configurable: base language, lang path, ignore keys, triggered file extensions
- Framework agnostic: works with any PHP project using Laravel-style
lang/files
Installation
Configuration
Add the extension and task to your grumphp.yml:
Options
| Option | Type | Default | Description |
|---|---|---|---|
base_lang |
string | en |
The reference language to compare against |
lang_path |
string | lang |
Path to the language files directory |
check_duplicates |
bool | true |
Check for duplicate keys in files |
triggered_by |
array | ['php'] |
File extensions that trigger the check |
ignore_keys |
array | [] |
Keys to skip during comparison |
auto_fix |
bool/string | false |
Auto-add missing keys from base language |
auto_stage |
bool/string | false |
Auto git add fixed files |
Auto-fix Mode
When auto_fix is enabled, missing keys are automatically copied from the base language:
Possible values for auto_fix and auto_stage:
false— disabled (default)true— always enabled'pre_commit'— only during git pre-commit'run'— only during manualgrumphp run
Ignoring Keys
Some keys are intentionally the same across languages (e.g., currency codes, abbreviations):
Expected Directory Structure
Each file returns a PHP array:
Example Output
When missing keys are found:
When duplicate keys are found:
Running Manually
License
MIT License. See LICENSE for details.