Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Language Switcher

Language Switcher Laravel Package

backpack/language-switcher

A Backpack for Laravel add-on that adds a language switcher dropdown to your admin panel's top bar, letting admins switch between configured locales for the interface or translated content. Simple configuration ties it to Laravel's localization system and your available languages.

View on GitHub
Deep Wiki
Context7

Backpack Language Switcher adds a simple language dropdown to your Backpack admin panel, letting administrators switch the interface locale without leaving the page. It integrates with Laravel localization and stores the selected language in the session, so the choice persists across admin requests.

  • Configurable list of supported languages
  • Dropdown in the Backpack top navigation
  • Persists selection in the user session
  • Works with Laravel’s standard lang files
  • Quick installation and config publishing
Frequently asked questions about Language Switcher
What is backpack/language-switcher used for?
It adds a locale dropdown to the Backpack admin panel so administrators can switch the active application language without leaving the page they are working on. It sits on top of Laravel's native localization and simply sets the locale for the current request or session. It does not translate your database content or manage translation files, so it is purely an operator-facing control.
How do I install backpack/language-switcher in a Laravel app?
Install it with Composer using composer require backpack/language-switcher, then publish the package config so you can define the list of locales you want to expose. Next, include the package's Blade partial in your Backpack base layout, typically in the topbar-right section or through a Backpack widget. A competent Laravel developer can usually complete the install and basic QA in about half a day on a stock theme.
Which Backpack and Laravel versions does backpack/language-switcher support?
The package is built as a multi-language dropdown for Backpack v6, so it assumes an admin panel running that major version and a standard Blade plus Bootstrap theme. Always check the composer.json constraints before installing, because the package is version-coupled to the Backpack base theme and its view structure. If your app is still on an older Backpack release, verify compatibility first or replicate the behavior with a native Blade component.
How do I configure which languages appear in the dropdown?
After publishing the package config, you define the locales you want to show, typically as a key-value map of locale codes to display labels. Only the languages in that list are rendered in the dropdown, so admins cannot accidentally switch to a locale your app does not support. Keep the list aligned with the lang directories and translation files your application actually ships.
Does backpack/language-switcher translate my multilingual CRUD content?
No. It only changes the active locale used by Laravel and the admin interface; it does not store, load, or fall back between translated database records. If you need multilingual Eloquent fields, pair this package with something like spatie/laravel-translatable or backpack/laravel-translatable and treat the switcher purely as the operator-facing control. The translation pipeline, fallback behavior, and editor preview flow are a much larger project than the switcher itself.
How do I persist the selected locale per user?
If locale is only a session preference, no database change is needed because the package can toggle the locale for the current session. To remember it per user, add a nullable locale column to the users table with a reversible migration, backfill it from your app.locale default, and add a small SetLocale middleware that applies the stored value. Apply that middleware only to the admin route group so public site and API responses keep their expected locale.
Can I use backpack/language-switcher with Filament or Laravel Nova?
No, it is tightly built for the Backpack admin chrome and has no meaningful path to reuse in Filament, Nova, or a bespoke admin panel. If your admin is not Backpack, skip this package and replicate the behavior with a native Blade component plus a SetLocale middleware in an hour or two. Adopting it is really a small lock-in amplifier for an existing Backpack commitment.
Will backpack/language-switcher conflict with my own SetLocale middleware?
It can if two mechanisms both set the application locale, because the result becomes order-dependent and hard to diagnose. Audit your existing locale middleware before installing and decide whether the package, your middleware, or a per-user preference is the single source of truth. Also watch out if your app already overrides the Backpack base layout, since the switcher include must be added to the correct section after upgrades.
Does backpack/language-switcher support RTL admin layouts?
The package focuses on rendering the dropdown and switching locale; full right-to-left layout behavior depends on your Backpack theme and CSS. RTL admin layouts have not been widely validated by the community given the package's small install base, so test any RTL locale against your actual theme before shipping. If RTL is a hard requirement, treat it as a separate front-end validation task.
Is backpack/language-switcher production-ready and actively maintained?
It is a small MIT-licensed package released in late 2025 and owned by the Backpack core team, which is a better maintenance signal than its low star count suggests. However, with only a handful of stars and essentially no dependents, there is little field validation, so edge cases around theme versions, RTL, and locale persistence will be yours to discover. Pin the version in composer.json, re-test the switcher after every Backpack or theme upgrade, and be prepared to vendor or fork roughly 100 lines of Blade if the package stalls.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource