bibrokhim/laravel-language-header
Laravel middleware/package that detects and sets the application locale from the HTTP Accept-Language header. Helps automatically localize responses based on the user’s browser or client language preferences, with simple Laravel integration.
/en, /fr) or cookies.Accept-Language or custom headers like X-Locale)./en/dashboard) → Use Laravel’s built-in locale() middleware.i18next).LocaleResolver).For Executives: "This lightweight Laravel package lets us serve users in their preferred language via HTTP headers—no cookies, no URL hacks. It’s a 10-minute setup that aligns with modern APIs (e.g., mobile apps, SPAs) and reduces friction for global users. Think of it as ‘set-and-forget’ localization: the server handles language detection automatically, while we retain control over fallbacks and analytics. Low risk, high reward for scaling multilingual features."
For Engineering:
*"The package adds a single service provider to parse headers (e.g., Accept-Language) and inject the locale into Laravel’s app. Key benefits:
X-Locale) or standard Accept-Language.LocaleResolved events for custom logic (e.g., logging, A/B tests).For Design/UX:
*"This enables ‘silent’ language switching—users get content in their browser/device language by default, without seeing /en in URLs. For example:
fr-FR in headers and serves French content.How can I help you explore Laravel packages today?