bit-mx/statamic-translate-lang-files
Edit Laravel/Statamic language files from the Statamic Control Panel. Browse locales and lang groups, update keys, save back to lang/{locale}/*.php, sync missing keys from a reference locale, optionally refresh caches, invalidate OPcache, and auto-commit to Git.
Architecture Fit
The package leverages Laravel’s service container and Statamic’s utility system, ensuring seamless integration with both ecosystems. Its modular design (domain services for locale/group discovery, save/sync operations) aligns well with Laravel’s dependency injection patterns. The Statamic-specific CP utility provides a user-friendly abstraction over raw language files, reducing cognitive load for non-technical stakeholders. The package’s adherence to Statamic’s utility API (e.g., access translation-manager utility permissions) ensures it fits within the platform’s security and access control model.
Integration Feasibility
lang/{locale}/*.php), excluding JSON/YAML/other formats without customization.refresh_caches, invalidate_opcache) and events (e.g., translate-lang-files::translated), allowing for tailored behavior.Technical Risk
Key Questions
access translation-manager utility).Stack Fit
Migration Path
lang/ directory).composer require bit-mx/statamic-translate-lang-files:^1.1.0
php artisan statamic-translate-lang-files:install
php artisan vendor:publish --tag=statamic-translate-lang-files-config
php artisan vendor:publish --tag=statamic-translate-lang-files-assets
config/statamic-translate-lang-files.php:
git_auto_commit if not needed.refresh_caches/invalidate_opcache based on caching strategy.php artisan cache:clear).php artisan statamic:permissions assign access translation-manager utility --to=translators
Compatibility
trans('hardcoded.key')).php artisan cache:clear in deploy scripts).Sequencing
php artisan translate-lang-files:sync-missing).Maintenance
lang/ to avoid accidental commits outside the CP utility.refresh_caches is enabled:
php artisan cache:clear
php artisan statamic:cache
opcache_reset() in custom code if needed.Support
access translation-manager utility).APP_DEBUG=true).storage/logs/laravel.log.# Edit directly
nano resources/lang/es/messages.php
sync-missing, generate).Scaling
translations table.php artisan translate-lang-files:sync-missing).lang/archive/).Failure Modes |
How can I help you explore Laravel packages today?