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(4mo ago)1247.0k↑48.5%5[1 issues](https://github.com/craft-forge/filament-language-switcher/issues)[2 PRs](https://github.com/craft-forge/filament-language-switcher/pulls)MITPHPPHP ^8.1

Since Sep 16Pushed 4mo 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 3d 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 93% of packages

Maintenance76

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity49

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

121d 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

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[awcodes/filament-quick-create

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

251218.2k12](/packages/awcodes-filament-quick-create)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

2317.4k](/packages/mradder-filament-logger)

PHPackages © 2026

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