- How do I install Laravel Lang translations for my Laravel 9/10 app?
- Run `composer require laravel-lang/lang` and publish the translations with `php artisan lang:publish`. This copies all language files to `resources/lang/vendor/lang`, which Laravel automatically loads. No additional configuration is needed for basic usage.
- Does this package support Laravel Jetstream/Fortify/Breeze auth translations?
- Yes, the package includes curated translations for Jetstream, Fortify, and Breeze auth messages (e.g., login, password reset, 2FA). Just publish the translations, and these will override Laravel’s default auth strings for all supported languages.
- Will this work with Laravel Nova or Cashier?
- Yes, the package covers Nova and Cashier translations, including subscription messages, invoices, and team-related terms. However, verify compatibility with your Nova/Cashier version, as some newer features may require manual updates.
- What if a language is missing critical translations (e.g., passkey errors)?
- Some languages (e.g., Bulgarian, Vietnamese) lack passkey-specific messages. Use fallback logic like `trans('lang::key', [], 'en')` or manually override missing keys in `resources/lang/{locale}/vendor/lang`. Contribute fixes to the repo to help the community.
- Does adding 128 languages slow down my Laravel app?
- Minimal impact if you use `config('app.fallback_locale')` to lazy-load only needed languages. For development, install with `--dev` to avoid bloating production. Test boot time with `php artisan optimize:clear` and Xdebug profiling.
- How do I override or extend translations for a specific locale?
- Place custom files in `resources/lang/{locale}/vendor/lang` (e.g., `resources/lang/fr/vendor/lang/auth.php`). Laravel’s precedence rules ensure your files override the package defaults. Useful for tailoring messages without forking the package.
- What Laravel versions are supported, and are there breaking changes?
- The package supports Laravel 8+, 9+, and 10+. Major updates align with Laravel releases, but some auth flows (e.g., passkeys) may require manual patches. Check the [changelog](https://github.com/laravel-lang/lang/blob/main/CHANGELOG.md) for version-specific notes.
- Can I use this for a non-Laravel PHP project?
- No, this package is Laravel-specific and relies on Laravel’s localization system (`trans()` helper, `config/app.php`). For vanilla PHP, use alternatives like Symfony’s `translation` component or gettext. Laravel’s ecosystem integrations (Jetstream, Nova) won’t work outside Laravel.
- How do I validate translations in CI before merging?
- Add a script to check for missing keys in critical paths (e.g., auth, validation) using `php artisan lang:dump` and diffing against a reference JSON. Tools like `laravel-lang/validator` or custom PHPUnit tests can automate this.
- What’s the best way to contribute missing translations?
- Fork the repo, add translations to the appropriate `.json`/`.php` files in `resources/lang/{locale}/vendor/lang`, and submit a PR. Follow the [contribution guidelines](https://laravel-lang.com/contributions.html). For large updates, open an issue first to discuss scope.