Releases: craft-forge/filament-language-switcher
v1.2.1
Full Changelog: v1.2.0...v1.2.1
Fixed
- Dropdown not opening on iOS devices
- Flag icon not updating after language switch in SPA mode
- Dropdown not closing after selection in SPA mode
- Nested button in trigger causing touch event conflicts on mobile
Changed
- Removed client-side filament-locale-changed JS event (unreliable with SPA)
Added
- Live demo link in README
v1.2.0 - Auth Pages & Cookie Persistence
New Features
-
Dynamic locales via Closure — load languages from a database or any dynamic source:
->locales(fn () => Language::pluck('code')->toArray()) -
Simplified locale syntax — pass plain language codes instead of arrays:
->locales(['en', 'fr', 'de']) -
Show on auth pages — display the language switcher on login, register, and password reset pages with a single method:
->showOnAuthPages() -
Cookie persistence — remember the selected locale across browser sessions:
->rememberLocale() -
LocaleChanged event (PHP) — react to locale changes on the backend with both new and previous locale:
Event::listen(LocaleChanged::class, function (LocaleChanged $event) {}); -
Browser event (JavaScript) — filament-locale-changed event dispatched after locale switch:
window.addEventListener('filament-locale-changed', (e) => {});
Improvements
- Locale validation — invalid locale codes (e.g. 'en, pl' instead of 'en', 'pl') now throw a clear error message
- Graceful SVG fallback — if a flag icon is not found, a fallback icon is shown instead of crashing
v1.1.0 Filament v5 support
Merge pull request #4 from MominAlZaraa/main updated composer to support filament v5.x
v1.0.1
Fixed
- Fixed "Session store not set on request" error when
SetLocalemiddleware runs beforeStartSessionmiddleware
v1.0.0 - Initial Release
- Automatic Detection: Scans available Filament translations automatically
- Flag Icons: Beautiful country flag icons with comprehensive language-to-country mappings
- Session Management: Persistent language selection using Laravel sessions
- Easy Integration: Simple one-line plugin registration
- Customizable: Optional custom language lists and flag display settings
- Universal Compatibility: Works with both Filament 3.x and 4.x