Overview
Thetranslate:validate command checks your translation files for missing keys by comparing target languages against your base language. It provides a comprehensive overview of translation coverage.
Syntax
Options
Validate only specific translation file(s). Provide a comma-separated list of file names (without extension).Example:
--name=messages,validationValidate specific language(s) only. Provide a comma-separated list of language codes.Example:
--language=es,fr,deThe source language to compare against. Defaults to the
app.locale configuration value.Example: --base-language=enCustom base path for translation files. Defaults to Laravel’s
lang_path() directory.Example: --lang-dir=/custom/path/langDisplay detailed output including all missing keys with their values. Without this flag, only a summary table is shown.
Examples
Output Examples
Summary View (Default)
Verbose Output
Understanding the Output
Status Indicators
- ✔ (Green checkmark): All translations are present for this domain/language combination
- Number (Red): The count of missing translation keys
- – (Red dash): The translation file doesn’t exist at all
Verbose Mode Details
When using the--verbose flag, you’ll see:
- Individual progress for each domain and language
- Tables showing each missing key alongside its value in the base language
- Keys are limited to 100 characters for display
- Values are limited to 70 characters for display
The validate command only checks for missing keys. It does not verify the quality or accuracy of existing translations.
Use Cases
CI/CD Integration
Use this command in your continuous integration pipeline to ensure translations are complete:Pre-Deployment Check
Run validation before deploying to production to catch missing translations:Focused Validation
Check specific files or languages when working on particular features:Related Commands
- translate - Automatically translate missing keys