laravel-lang/publisher
Developer tool for Laravel Lang: publish and manage translation files in your Laravel app. Installs via Composer and provides commands to pull package locales into your project so you can customize and keep language resources up to date.
resources/lang/) and Artisan commands. Aligns perfectly with Laravel’s service container, config files, and CLI-driven workflows.laravel-lang/locales), enabling selective adoption (e.g., only publish auth/validation files initially)..env overrides, project name checks) and hooks for post-publish logic (e.g., triggering CI workflows).lang/ directory structure. No changes to routes, controllers, or Blade templates required.lang:publish, lang:update, and lang:remove commands, fitting seamlessly into existing CI/CD pipelines (e.g., GitHub Actions, GitLab CI).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Breaking Changes | Medium | Monitor release notes for Laravel version drops (e.g., v15+ may drop v10 support). |
| Translation Conflicts | High | Use --force flag judiciously; test in staging before prod updates. |
| Custom Key Overrides | Medium | Document exclusion rules in config/publisher.php to preserve local changes. |
| CI/CD Pipeline Impact | Low | Add lang:update to post-merge workflows to avoid manual syncs. |
| Performance | Low | Minimal runtime overhead; only impacts initial publish/update (file operations). |
| Localization Quality | Medium | Validate translations via Laravel Lang’s community or integrate with a lightweight QA tool (e.g., Crowdin API). |
Localization Strategy:
CI/CD Integration:
lang:update run automatically on main branch merges, or require manual triggers for controlled updates?Scalability:
Customization Needs:
.xlf files, custom validators)?Compliance:
Team Adoption:
composer require --dev laravel-lang/publisher.php artisan lang:publish).| Phase | Action | Tools/Commands | Risks |
|---|---|---|---|
| Assessment | Audit existing resources/lang/ for conflicts with Laravel Lang files. |
diff, git diff |
Key collisions, custom overrides. |
| Pilot | Publish core translations (e.g., auth.php, validation.php) to a staging branch. |
php artisan lang:publish |
Breakage in localized features. |
| Validation | Test all locales and user flows (e.g., login, form validation). | Manual QA + automated tests. | Missing translations, UI issues. |
| CI/CD Integration | Add lang:update to post-merge workflows for main branch. |
GitHub Actions/GitLab CI. | Flaky updates, permission issues. |
| Rollout | Merge to prod; monitor for translation errors in logs. | Sentry, Laravel logs. | Runtime errors, missing keys. |
| Optimization | Exclude custom files from auto-updates; add custom validators. | config/publisher.php overrides. |
Over-maintenance. |
>=15.0.0 for v10+).laravel-lang/locales).config/publisher.php under ignore.resources/lang/ (critical for rollback).composer require --dev laravel-lang/publisher
php artisan vendor:publish --provider="LaravelLang\Publisher\PublisherServiceProvider"
.env (if using PUBLISHER_* vars).config/publisher.php (e.g., default locale, ignored files).php artisan lang:publish --locale=en --force
php artisan lang:update --dry-run to preview changes..github/workflows/locales.yml:
- name: Update translations
run: php artisan lang:update --locale=*
App\Exceptions\Handler.lang:update commands.composer update laravel-lang/publisher in CI.config/publisher.php in version control..env) for **sensitive/How can I help you explore Laravel packages today?