- How do I install Laravel Lang Status Generator for my Laravel project?
- Run `composer require laravel-lang/status-generator --dev` to install it as a development dependency. The package integrates seamlessly with Laravel’s Artisan CLI and requires no runtime configuration.
- Which Laravel versions does this package support?
- The package is optimized for Laravel 8.x through 13.x. It leverages Laravel’s translation system and Symfony 7/8 components, so it won’t work with older Laravel versions (e.g., 7.x or below).
- Can I use this to generate translations for custom locales not supported by Google Translate?
- Yes, the `lang create` command generates empty locale stubs for any language code (e.g., `vendor/bin/lang create --locale=xx`). Google Translate integration is optional and only used for auto-translation drafts.
- How do I sync translations from Laravel Framework or Jetstream into my project?
- Use the `lang download` command with the `--url` flag pointing to a Laravel/Jetstream release ZIP. For example, `vendor/bin/lang download --url=https://github.com/laravel/framework/archive/refs/heads/9.x.zip --project=framework --ver=9.x` fetches and merges translations.
- Will this package work with non-Laravel PHP projects (e.g., Symfony standalone or Lumen)?
- No, it’s designed for Laravel’s `trans()` helper and `resources/lang/` structure. Symfony standalone or Lumen projects would need custom adapters to replicate Laravel’s translation system, which isn’t supported out of the box.
- How do I handle Google Translate API quotas or rate limits in production?
- The package uses Google Translate’s free tier (100k chars/day) but requires manual setup of an API key. For high-volume projects, consider caching translations locally or implementing fallback strategies like manual review for low-priority keys.
- Can I integrate this into a CI/CD pipeline to enforce translation coverage?
- Yes, run `vendor/bin/lang status` in CI to check coverage. Add a step to fail builds if coverage drops below a threshold (e.g., 90%). Use `--only-copy` to avoid modifying files during CI if needed.
- What happens if I sync translations from an upstream repo and there are merge conflicts?
- The package copies files by default, but conflicts may occur if keys overlap. Use `--only-copy` to bypass key lookups, or manually resolve conflicts post-sync. Consider using Git pre-commit hooks to validate translations before merging.
- Does this package support dynamic translation keys (e.g., Blade macros or ternary operators)?
- It handles standard Laravel translation keys (`trans('key')`) but may miss dynamic keys in complex templates (e.g., `{{ trans('key.'. $var) }}`). Test thoroughly with your project’s templates, and report edge cases to the maintainers for fixes.
- How do I exclude sensitive keys (e.g., API tokens) from auto-generation?
- The package doesn’t auto-generate translations for keys—it only creates stubs or syncs existing files. Manually exclude sensitive keys from your `resources/lang/` files or use environment-specific overrides (e.g., `.env`-based config).