- How do I install goodcat/laravel-l10n in a Laravel project?
- Install it with Composer and register the service provider, then publish the config and language stubs. The package is designed as a lightweight localization layer, so you also add its middleware to the web group and use the localized route wrappers. A working pilot in an additional locale is typically a 1–3 day effort plus translation content time.
- What Laravel versions does goodcat/laravel-l10n support?
- The supplied context does not list specific Laravel version constraints. Check the package composer.json and repository for the supported Laravel and PHP ranges before adopting it. Because v0.5.3 includes breaking changes, confirm the version you install matches your Laravel version and your app's locale configuration.
- What breaking changes are in goodcat/laravel-l10n v0.5.3?
- Despite the patch-level number, v0.5.3 changes the preferred locale config key from app.preferred_locale to app.preferred_locales, with no dual-read fallback described. The PreferredLocaleUpdated event payload changes from locale/previousLocale to locales/previousLocales, and LocaleResolver::resolve() may now return a list instead of a string. SessionLocale is deprecated in favor of writing your own LocaleResolver.
- How does locale detection work with the Accept-Language header?
- The package now resolves locales as an array and exposes getPreferredLocales(), so an Accept-Language header with quality values can be honored as a quality-ordered list rather than truncated to one tag. That is a change from the earlier single resolve(): string contract. If you have custom resolvers, audit and retype them to handle list-based results.
- How do I let users switch language and remember their preference?
- The package provides language-switching helpers, but SessionLocale is deprecated in v0.5.3. The recommended path is to write your own LocaleResolver for session-backed preference storage and register it with the package. That keeps preference persistence in application code you own and test.
- What is RedirectToPreferredLocale and how do I prevent redirect loops?
- RedirectToPreferredLocale is middleware that redirects a first-time visitor to their best-matching locale, making the package responsible for a navigation decision with SEO and caching consequences. Sequence it after session start and make sure it does not fight an existing Accept-Language redirect at your proxy or CDN. Budget about half a day to wire it and test it against your edge infrastructure because this is where redirect loops tend to appear.
- Can I use goodcat/laravel-l10n with Inertia, TypeScript, or Wayfinder?
- Yes, the Inertia and TypeScript via Wayfinder fit is rated moderate and improved in v0.5.3. The exported LocalizedRoutes type and fixed TypeScript signature forwarding make it more usable in a typed frontend. Expect roughly half a day to one day to consume LocalizedRoutes and re-verify route helper signatures after the argument-forwarding fixes.
- Is goodcat/laravel-l10n suitable for an existing app with hand-rolled locale middleware?
- The fit is weak to moderate, and v0.5.3 makes it slightly worse because the package's resolution semantics are mid-flight with list-based results. Reconciling it with an incumbent SetLocale middleware is a moving target. Existing adopters should treat v0.5.3 as not drop-in and audit config keys, event listeners, and custom resolvers.
- How long does it take to integrate goodcat/laravel-l10n into production?
- A greenfield install is mechanically straightforward: Composer, provider registration, publishing config and language stubs, middleware on the web group, and localized route wrappers. Plan 1–3 days for a working pilot in one additional locale plus translation content time. Add about half a day for RedirectToPreferredLocale and proxy/CDN testing, and half a day to one day for a typed frontend surface.
- What are the alternatives to goodcat/laravel-l10n for Laravel localization?
- The supplied context does not name specific alternatives. It positions goodcat/laravel-l10n as an opinionated localization layer that owns translation file structure, active locale resolution, route prefixes, and language switching, so compare alternatives by how much of that structure they assert. If you want to keep session preference storage and custom middleware in your own code, a lighter helper package or hand-rolled middleware may fit better.