Language Switch plugin screenshot
No dark mode support
No multilingual support
Supports v5.x

Language Switch by Eii Tech Solutions

Community

Add a top-bar language switcher dropdown to your Filament panel. Supports configurable locales with native names, optional SVG flags, LTR/RTL directions, and persists the selected language via session and cookie. Fully customizable with publishable config, views, and flag assets.

Tags: Developer Tool Panels
Supported versions:
5.x
Eii Tech Solutions avatar Author: Eii Tech Solutions

Package health

Automated checks of this plugin's Composer package

95 / 100
Security 91
Maintenance 100
Ecosystem 100
17 checks
  • Skipped: GitHub Actions pinned to SHA
  • Skipped: GitLab CI includes pinned to SHA
  • Failed: Recent release is immutable — The tag v1.0.3 was pushed without a release. Only releases can be made immutable, so the tag can still be moved. View details on Plumb
  • Passed: Release tags have not been moved — No version tag has been seen moving.
  • Passed: Open security advisories
  • Passed: Dependabot PR responsiveness — No open Dependabot PRs.
  • Skipped: Renovate MR responsiveness
  • Passed: Dependabot or Renovate configured
  • Passed: Dependency update cooldown configured
  • Passed: Provides a security policy
  • Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
  • Passed: Commit and release recency — Active: last commit 2 days ago; last release 2 days ago.
  • Passed: composer.lock not committed by library — composer.lock is absent from the released dist archive.
  • Passed: Dist archive is lean
  • Passed: Current Laravel version supported — Package dependencies resolve together with current Laravel 13.0.
  • Passed: Current PHP version supported — Constraint ^8.3 supports current PHP 8.6.
  • Skipped: Current Symfony version supported
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 4 hours ago

Documentation

Filament Language Switch

A lightweight Filament v5 plugin that adds a topbar language switcher to your panel.

It persists the selected locale in session + cookie, applies it on each panel request, and supports LTR / RTL language directions.

#Features

  • Topbar dropdown switcher for supported locales
  • Works with Filament Panels (v5)
  • Locale persistence using session and cookie
  • Configurable default/fallback locales
  • Configurable locale metadata (name, native, dir, country, flag)
  • Optional custom SVG folder via flags_path
  • Built-in starter SVG flags with fallback resolution
  • RTL-ready via locale direction config
  • Publishable config, views, and starter flags

#Requirements

  • PHP 8.3+
  • Laravel 13+
  • Filament 5+

#Installation

composer require eii/filament-language-switch

Laravel package discovery registers the service provider automatically.

#Filament Panel Registration

Register the plugin on each panel where you want the switcher to appear.

Important: register the plugin after panel middleware configuration.

use Eii\FilamentLanguageSwitch\LanguageSwitchPlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->middleware([
            // your middleware...
        ])
        ->plugin(LanguageSwitchPlugin::make());
}

#Configuration

Publish config:

php artisan vendor:publish --tag=filament-language-switch-config

Then edit config/localization.php:

return [
    'default' => env('APP_LOCALE', 'en'),
    'fallback' => env('APP_FALLBACK_LOCALE', 'en'),

    // Toggle flags on/off (default: false)
    'show_flags' => env('LOCALIZATION_SHOW_FLAGS', false),

    // Optional path to your own SVG flag files (absolute or relative to base_path)
    'flags_path' => env('LOCALIZATION_FLAGS_PATH', null),

    'locales' => [
        'en' => [
            'name' => 'English',
            'native' => 'English',
            'dir' => 'ltr',
            'country' => 'US', // Optional: country name or code (e.g. 'US' or 'United States')
            'flag' => null, // Optional: inline SVG string or filename in flags_path (e.g. 'us.svg')
        ],
        'ar' => [
            'name' => 'Arabic',
            'native' => 'العربية',
            'dir' => 'rtl',
            'country' => 'SA',
            'flag' => null,
        ],
    ],
];

#Display Format Rules

  • If show_flags is true: <flag> <locale> (<country>) (or <flag> <locale> if country is blank).
  • If show_flags is false: <locale> (<country>) (or <locale> if country is blank).
  • Selected language is highlighted in Filament's primary color with a sleek circular dot indicator instead of a plain checkmark.
  • The developer can choose to provide a country code (e.g. US), a full country name (e.g. United States), or leave it blank.
  • The flag can be an inline <svg>...</svg> string, or a filename inside the flags_path directory (e.g. 'us.svg').
  • Resolution order: locales.*.flag (inline SVG or filename) → flags_path/{country|locale}.svg → built-in package flag views.

If only one locale is configured, the dropdown is hidden automatically.

#Customize Switcher Position (Render Hook)

Default hook: PanelsRenderHook::GLOBAL_SEARCH_AFTER

You can move it:

use Filament\View\PanelsRenderHook;

->plugin(
    LanguageSwitchPlugin::make()
        ->renderHook(PanelsRenderHook::TOPBAR_END)
)

#Starter Flags (Built-in + Your Own)

The package includes a small starter set under the internal filament-language-switch::flags.* views.

To use your own full set, place SVG files in any folder (for example resources/flags/filament-language-switch) and set:

LOCALIZATION_FLAGS_PATH=resources/flags/filament-language-switch

Or set directly in config (absolute or relative to base_path()):

'flags_path' => 'resources/flags/filament-language-switch',

You can also publish the starter SVG files:

php artisan vendor:publish --tag=filament-language-switch-flags

#Publish and Customize View

php artisan vendor:publish --tag=filament-language-switch-views

Published path:

resources/views/vendor/filament-language-switch/locale-switcher.blade.php

#How It Works

  • The switcher calls GET /locale/{locale}
  • Locale is validated against localization.locales
  • Locale is stored in session and cookie
  • Middleware resolves locale in this order:
    1. Session
    2. Cookie
    3. localization.default
  • app()->setLocale(...) and Carbon locale are applied per request

#Security

Please review SECURITY.md for vulnerability reporting.

#License

This package is open-sourced software licensed under the MIT License.


Alt text

Developed and maintained by Amit Haldar

From Eii Tech Solutions

If you find this package useful, consider giving it a ⭐ on GitHub!

The author

Eii Tech Solutions avatar Author: Eii Tech Solutions

Eii Tech Solutions is a software development company based in Tokyo, Japan. We build practical Laravel and Filament packages, developer tools, and reusable solutions focused on simplicity, reliability, and security. Our packages are developed and maintained by Amit Haldar, with a focus on making everyday development easier for the Laravel and Filament community.

Plugins
7
Stars
6

From the same author