mcamara/laravel-localization
Laravel localization package for i18n: detect locale from browser, redirect and persist locale via session/cookie, define routes once with localized URL prefixes and translatable routes, optional hiding of default locale, plus helpers like language selectors.
/en/about vs /es/sobre-mi) while supporting clean URLs for default locales (e.g., /about instead of /en/about).resources/views/en/, resources/views/es/). Aligns with Laravel’s built-in localization features (e.g., __() for translations).getCurrentLocaleDirection()).Adopt When:
Look Elsewhere If:
php artisan route:cache): Migrate to niels-numbers/laravel-localizer (recommended successor).bestmomo/laravel-locale.spatie/laravel-translatable for database-level localization.laravel-i18n.*"This package lets us launch in new markets without rewriting our entire routing system. For example:
/fr/), reducing bounce rates.
Competitors like Shopify and Airbnb use similar approaches to dominate global markets. This is a low-risk, high-reward investment."*"This solves three critical pain points in Laravel localization:
Route::get('/about')) and let the package generate /en/about, /es/sobre-mi, etc./about for default locale) and avoids duplicate content issues with search engines.{{ LaravelLocalization::localizeUrl('/path') }}.LocaleSessionRedirect).resources/views/{locale}/ for template isolation.
It’s battle-tested (3.5K stars, 10+ years), MIT-licensed, and integrates seamlessly with Laravel’s existing localization features. The only trade-off is dynamic route generation (no route:cache support), but the successor package fixes that if needed."*"This package enables:
LaravelLocalization::getLocalesOrder()./es/producto instead of inconsistent paths like /products?id=lang=es.
No more manual URL handling—just focus on designing the UI for each locale."How can I help you explore Laravel packages today?