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
Nova Language Switch

Nova Language Switch Laravel Package

badinansoft/nova-language-switch

A Laravel Nova tool that adds a language switcher to the Nova admin panel, letting you change the interface locale on the fly. Supports configurable languages, remembers the selection, and integrates cleanly with Nova's localization.

View on GitHub
Deep Wiki
Context7

A Laravel Nova package to switch language in your application

Frequently asked questions about Nova Language Switch
How do I install badinansoft/nova-language-switch in Laravel Nova?
Run composer require badinansoft/nova-language-switch, then register the tool in the tools array of app/Nova/NovaServiceProvider.php. Laravel package auto-discovery should register the service provider, and you can publish the languages config if you need custom locales. Clear config and view caches, then confirm the locale dropdown appears in the Nova header. The integration is additive and reversible.
Does nova-language-switch translate my application or just change the locale?
It does not translate anything itself. It changes the locale the application resolves on subsequent requests, so you still need Laravel translation files for each supported language. Its scope is primarily Nova admin UI chrome, not automatic translation of front-end content or database records.
Which Laravel and Nova versions are supported by nova-language-switch?
Release 3.0.0 from January 2025 adds Nova 5 support, while earlier releases target Nova 4. The provided material does not state exact laravel/framework or laravel/nova Composer constraints, so check composer.json and Packagist before pinning. Validate against your pinned Laravel and Nova minor versions because Nova tool APIs can break between majors.
How do I configure the available languages in the Nova language switcher?
Publish the package configuration and edit the languages map to list the locales you want in the dropdown. The package supports configurable languages, so the switcher should reflect that map rather than a hard-coded list. Keep locale codes consistent with your Laravel translation directories and any users.locale values.
Does nova-language-switch remember the selected language between requests?
Yes, it remembers the selection by writing the chosen locale where the request pipeline can read it, session by default. That means the selection persists for the session, not necessarily in the user profile. If your application treats users.locale as the source of truth, verify the package writes to the same place or adapt it.
Can I use nova-language-switch without Laravel Nova, and what alternatives exist?
No. This package is a Nova tool and requires Laravel Nova as the admin surface with a server-resolved locale. API-only services, Filament panels, and SPA or Inertia front ends without server locale resolution get no partial value. For those stacks, use a Filament language switcher, a custom locale middleware plus UI, or an application-level user preference instead.
How does nova-language-switch interact with Laravel localization middleware and session?
The package writes the selected locale to session by default, and your application must honor that mechanism on later requests. Confirm that session middleware runs before locale resolution and that Nova middleware, web middleware, queues, Octane workers, and shared caches are consistent. The provided material does not confirm whether it ships middleware, so inspect the package and test ordering.
Can locale selection leak into queued jobs, Octane workers, or cached responses?
Yes, that is the highest-severity risk. Session- or singleton-scoped locale that is not reset per request can contaminate queued jobs, Octane workers, and cached responses, producing wrong-language emails or pages without a stack trace. Reset locale per request and job, include locale in cache keys or Vary headers, and avoid singleton locale state.
Can I restrict the language switcher to certain Nova users?
The provided material does not document a built-in permission gate. Nova tools can often be gated through Nova authorization mechanisms, but verify the tool class supports it and test with a non-admin user. If it does not, fork the tool into app/Nova/Tools and add a canSee or authorization check.
Is nova-language-switch actively maintained, and should I fork it?
Treat it as a small, single-maintainer package with about 26 stars and no community backstop, not a heavily supported dependency. Release 3.0.0 adds Nova 5 support, but compatibility review is a recurring cost at each Nova major bump. Because the code is small, forking under your namespace is a realistic first option and gives near-zero exit cost.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections