laravel-lang/status-generator
Dev-only Laravel Lang tool to create missing locales and download/copy translation files from Laravel, framework, Jetstream and more. Includes CLI commands for generating locale stubs, fetching zips by version, and copying lang paths with optional key lookup.
composer require laravel-lang/status-generator --dev
php artisan vendor:publish --provider="LaravelLang\StatusGenerator\StatusGeneratorServiceProvider"
vendor/bin/lang status
Use lang status to generate a report of translation completeness across all locales. This helps identify missing or incomplete translations before a release.
vendor/bin/lang (or php artisan lang:* if registered as an artisan command).config/lang-status.php (if published).lang sync to ensure all translation keys exist in target locales.Initial Setup
vendor/bin/lang create --locale=es --locale=fr
vendor/bin/lang download --url=https://github.com/laravel/framework/archive/refs/heads/10.x.zip --project=framework --ver=10.x
Daily Maintenance
vendor/bin/lang sync
vendor/bin/lang translate --google-key=YOUR_API_KEY
vendor/bin/lang status
Multi-Project Sync
--copy to mirror translations from other projects (e.g., Jetstream):
vendor/bin/lang download --url=https://github.com/laravel/jetstream/archive/refs/heads/2.x.zip --project=jetstream --ver=2.x --copy=lang
lang sync and lang status to your pre-release checks to fail builds if translations are incomplete.lang sync in a pre-commit hook to ensure translation keys are never missed.# 1. Create new locales
vendor/bin/lang create --locale=de --locale=ja
# 2. Sync keys from English to new locales
vendor/bin/lang sync
# 3. Translate missing keys via Google Translate
vendor/bin/lang translate --google-key=$GOOGLE_API_KEY
# 4. Verify status before release
vendor/bin/lang status
Google Translate API Key Required
translate command requires a Google Cloud API key. Without it, you’ll need to manually translate keys or disable the feature.Key Detection Limitations
--only-copy to bypass key detection if you’re certain about file structures.Locale File Structure Assumptions
resources/lang/{locale}/). Custom paths may break commands.config/lang-status.php or extend the package.English Locale Dependency
sync and download rely on an existing English (en) locale. Missing en files may cause errors.vendor/bin/lang create without arguments to generate all missing locales.Symfony Version Conflicts
composer.json.--verbose to commands for detailed logs (e.g., vendor/bin/lang sync --verbose).--dry-run with download or sync to preview changes without applying them.storage/logs/laravel.log. Look for parser or file structure issues.Custom Parsers
LaravelLang\StatusGenerator\Parser\Parser to handle project-specific translation patterns (e.g., custom blade directives like @transCustom).namespace App\Extensions;
use LaravelLang\StatusGenerator\Parser\Parser;
class CustomParser extends Parser {
protected function detectKeys($content) {
// Add custom regex or logic here
return parent::detectKeys($content);
}
}
Custom Status Reports
status command to generate custom reports (e.g., CSV, JSON) by extending LaravelLang\StatusGenerator\Commands\StatusCommand.Pre-Translation Hooks
shouldTranslate method in your custom command.Post-Sync Processing
queue:work to process translations asynchronously after lang sync for large projects.vendor/, node_modules/). Add exclusions to config/lang-status.php:
'excludes' => [
'path/to/exclude',
],
'locale_paths' => [
'custom/lang',
],
lang status if running frequently in development.parallel-lint or similar tools to speed up key detection in large codebases.How can I help you explore Laravel packages today?