PHPackages                             craft-forge/filament-language-switcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. craft-forge/filament-language-switcher

ActiveLibrary[Admin Panels](/categories/admin)

craft-forge/filament-language-switcher
======================================

Zero-config language switcher for Filament admin panels. Automatically scans available translations, renders dropdown with country flags, persists selection via sessions.

v1.2.1(2mo ago)1016.4k↑10.2%5[2 PRs](https://github.com/craft-forge/filament-language-switcher/pulls)MITPHPPHP ^8.1

Since Sep 16Pushed 2mo agoCompare

[ Source](https://github.com/craft-forge/filament-language-switcher)[ Packagist](https://packagist.org/packages/craft-forge/filament-language-switcher)[ Docs](https://github.com/craft-forge/filament-language-switcher)[ RSS](/packages/craft-forge-filament-language-switcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (6)Used By (0)

Filament Language Switcher
==========================

[](#filament-language-switcher)

A simple and elegant language switcher plugin for Filament admin panels. Automatically detects available Filament translations or allows custom language configuration with optional flag icons. Supports auth pages, cookie persistence, and locale change events.

[![Language Switcher Demo](.github/language-switcher-demo.png)](.github/language-switcher-demo.png)

[![Language Switcher In Dark Mode](.github/language-switcher-dark-mode.png)](.github/language-switcher-dark-mode.png)

Demo
----

[](#demo)

[**→ Live Demo**](https://craftforge.io/admin/translations)

Installation
------------

[](#installation)

Plugin VersionFilament VersionPHP Version1.x3.x, 4.x, 5.x&gt; 8.1**1. Install the package via Composer:**

```
composer require craft-forge/filament-language-switcher
```

**2. Register the plugin in your Filament panel configuration (e.g. `AdminPanelProvider`):**

```
use CraftForge\FilamentLanguageSwitcher\FilamentLanguageSwitcherPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentLanguageSwitcherPlugin::make(),
        ]);
}
```

The plugin will automatically detect available Filament language files and display them in a dropdown menu.

Configuration
-------------

[](#configuration)

### Locales

[](#locales)

By default, the plugin auto-detects available Filament language files. To define the locale list manually, pass it to `locales()` - choose one of three formats:

**Locale codes** - names and flags are resolved automatically from the built-in dictionary (200+ languages):

```
FilamentLanguageSwitcherPlugin::make()
    ->locales(['en', 'fr', 'de'])
```

**Full control** - specify name and flag per locale. Flag codes reference: .

```
FilamentLanguageSwitcherPlugin::make()
    ->locales([
        ['code' => 'en', 'name' => 'English', 'flag' => 'us'],
        ['code' => 'fr', 'name' => 'Français', 'flag' => 'fr'],
        ['code' => 'de', 'name' => 'Deutsch', 'flag' => 'de'],
    ])
```

**Dynamic** - load locales at runtime (e.g. from a database):

```
FilamentLanguageSwitcherPlugin::make()
    ->locales(fn () => Language::pluck('code')->toArray())
```

[![Language Switcher Locales](.github/language-switcher-custom-languages.png)](.github/language-switcher-custom-languages.png)

### Remember Locale

[](#remember-locale)

Store the selected locale in a cookie to persist across browser sessions (e.g. after logout):

```
FilamentLanguageSwitcherPlugin::make()
    ->rememberLocale()          // forever
    ->rememberLocale(days: 30)  // for 30 days
```

### Custom Render Hook

[](#custom-render-hook)

Change where the language switcher appears in the panel:

```
use Filament\View\PanelsRenderHook;

FilamentLanguageSwitcherPlugin::make()
    ->renderHook(PanelsRenderHook::USER_MENU_PROFILE_AFTER)
```

Popular placements:

- `USER_MENU_BEFORE` — before the user menu (default)
- `USER_MENU_PROFILE_AFTER` — after user profile in dropdown
- `USER_MENU_AFTER` — after the user menu
- `SIDEBAR_FOOTER` — at the bottom of sidebar
- `FOOTER` — in the page footer

All available render hooks: [https://filamentphp.com/docs/5.x/advanced/render-hooks](https://filamentphp.com/docs/5.x/advanced/render-hooks#available-render-hooks)

[![Language Switcher Render Hook](.github/language-switcher-render-hook.png)](.github/language-switcher-render-hook.png)

### Show on Auth Pages

[](#show-on-auth-pages)

Display the language switcher on login, register, and password reset pages:

```
FilamentLanguageSwitcherPlugin::make()
    ->showOnAuthPages()
```

### Hide Flags

[](#hide-flags)

Display only language names without flag icons:

```
FilamentLanguageSwitcherPlugin::make()
    ->showFlags(false)
```

Event
-----

[](#event)

The plugin dispatches a `LocaleChanged` event whenever a user switches locale, providing both the new and previous locale:

```
use CraftForge\FilamentLanguageSwitcher\Events\LocaleChanged;
use Illuminate\Support\Facades\Event;

public function boot(): void
{
    Event::listen(LocaleChanged::class, function (LocaleChanged $event) {
        // auth()->user()->setLocale($event->newLocale);
        // Log::info("Locale changed from {$event->oldLocale} to {$event->newLocale}");
    });
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance85

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Total

5

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4dfc499a8808fe7cefe3e44c5fe95af47f8c681902753eaa363e0b70e672e97?d=identicon)[craft-forge](/maintainers/craft-forge)

---

Top Contributors

[![taras-koval](https://avatars.githubusercontent.com/u/26673933?v=4)](https://github.com/taras-koval "taras-koval (20 commits)")[![craft-forge](https://avatars.githubusercontent.com/u/230239613?v=4)](https://github.com/craft-forge "craft-forge (1 commits)")[![MominAlZaraa](https://avatars.githubusercontent.com/u/64691179?v=4)](https://github.com/MominAlZaraa "MominAlZaraa (1 commits)")

---

Tags

filamenti18nlanguage-switchlanguage-switcherlaravellocalizationphplaravellocalizationi18nlanguageswitcheradminfilament

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/craft-forge-filament-language-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/craft-forge-filament-language-switcher/health.svg)](https://phpackages.com/packages/craft-forge-filament-language-switcher)
```

###  Alternatives

[awcodes/filament-quick-create

Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items.

246177.6k7](/packages/awcodes-filament-quick-create)[andreia/filament-ui-switcher

Add a modal with options to switch between different UI layouts and styles (colors, fonts, font sizes).

233.8k](/packages/andreia-filament-ui-switcher)[inerba/filament-db-config

A Filament plugin for database-backed application settings and editable content, with caching and easy page generation.

329.1k](/packages/inerba-filament-db-config)[caresome/filament-neobrutalism-theme

A neobrutalism theme for FilamentPHP admin panels

303.2k](/packages/caresome-filament-neobrutalism-theme)[redberry/page-builder-plugin

Page builder plugin for filamentphp admin panel to build pages using blocks.

242.8k](/packages/redberry-page-builder-plugin)[jeffersongoncalves/filament-topbar

A simple yet effective Filament plugin that automatically adds a customized topbar to your Filament admin panel. This plugin enhances your Filament panel's user experience by replacing the default topbar component with an improved version that displays navigation and user interface elements in strategic locations.

171.2k](/packages/jeffersongoncalves-filament-topbar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
