PHPackages                             bab55z/laravel-locale-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. [Localization &amp; i18n](/categories/localization)
4. /
5. bab55z/laravel-locale-switcher

ActiveLibrary[Localization &amp; i18n](/categories/localization)

bab55z/laravel-locale-switcher
==============================

Laravel locale switcher

1.0.2(4y ago)136MITPHPPHP ^7.1.3

Since Dec 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bab55z/Laravel-locale-switcher)[ Packagist](https://packagist.org/packages/bab55z/laravel-locale-switcher)[ RSS](/packages/bab55z-laravel-locale-switcher/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Laravel-locale-switcher
=======================

[](#laravel-locale-switcher)

Easy and fast locale switching package for your laravel app.

Instalation with composer
-------------------------

[](#instalation-with-composer)

`composer require bab55z/laravel-locale-switcher:1.0.2 `

Publish config file
-------------------

[](#publish-config-file)

php artisan vendor:publish --provider="Bab55z\\LaravelLocaleSwitcher\\LaravelLocaleSwitcherServiceProvider" --tag="config"

Available settings
------------------

[](#available-settings)

**status** : true enables locale switching management

**languages** : supported locales by your app

**redirect-to** : redirect page after locale switched successfully, leave blank to redirect user to the previous page

Usage
-----

[](#usage)

### Update th config file with languages supported by your laravel app

[](#update-th-config-file-with-languages-supported-by-your-laravel-app)

```
'languages' => [
        /**
         * Key is the Laravel locale code
         * Index 0 of sub-array is the Carbon locale code
         * Index 1 of sub-array is the PHP locale code for setlocale()
         * Index 2 of sub-array is whether or not to use RTL (right-to-left) css for this language
         * Index 3 of sub-array is displayable name
         */
        'en'    => ['en', 'en_US', false, 'English'],
        'de'    => ['de', 'de_DE', false, 'Deutsch'],
        'pl'    => ['pl', 'pl_PL', false, 'Polski'],
        'fr'    => ['fr', 'fr_FR', false, 'Français'],
        'es'    => ['es', 'es_ES', false, 'Español'],
        'it'    => ['it', 'it_IT', false, 'Italiano'],
        'pt'    => ['pt_BR', 'pt_PT', false, 'Português'],
        /*'ar'    => ['ar', 'ar_AR', true, 'العربية'],
        'da'    => ['da', 'da_DK', false, 'Dansk'],
        'sv'    => ['sv', 'sv_SE', false, 'Svenska'],
        'th'    => ['th', 'th_TH', false, 'Thailändisch'],*/
    ],

```

### Add routes to your blade files

[](#add-routes-to-your-blade-files)

- sample #1 : adds links statically

```

      {{app()->getLocale() == 'pl' ? ' English' : ' Polski'}}

```

 [![](https://github.com/bab55z/Laravel-locale-switcher/raw/readme-update/static/animstatic_.gif)](https://github.com/bab55z/Laravel-locale-switcher/raw/readme-update/static/animstatic_.gif)

- sample #2 : adds links dynamically

```

  @foreach(config('langswitcher.languages') as $locale => $localeDetails)
    {{--highlight active language --}}
    @if(strtolower(app()->getLocale()) == strtolower($locale))

         &nbsp;

            {{$localeDetails[3]}}

    @endif
  @endforeach

  @foreach(config('langswitcher.languages') as $locale => $localeDetails)
      @if(strtolower(app()->getLocale()) != strtolower($locale))

           &nbsp;

            {{$localeDetails[3]}}

      @endif
  @endforeach

```

 [![](https://github.com/bab55z/Laravel-locale-switcher/raw/readme-update/static/animdynamic.gif)](https://github.com/bab55z/Laravel-locale-switcher/raw/readme-update/static/animdynamic.gif)

Thanks ;)
=========

[](#thanks-)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~243 days

Total

4

Last Release

1618d ago

Major Versions

v0.1-beta.1 → 1.0.02020-01-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/4845d1c4393c794abab60ee865ec37f2c681935b1af78eaa2d8b751b83cece16?d=identicon)[bab55z](/maintainers/bab55z)

---

Top Contributors

[![bab55z](https://avatars.githubusercontent.com/u/2848498?v=4)](https://github.com/bab55z "bab55z (28 commits)")

---

Tags

languagelaravellocalizationphplaravellocalizationlocale

### Embed Badge

![Health badge](/badges/bab55z-laravel-locale-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/bab55z-laravel-locale-switcher/health.svg)](https://phpackages.com/packages/bab55z-laravel-locale-switcher)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)[cariboufute/locale-route

A testable route package with localization for Laravel 5 to 12

206.7k](/packages/cariboufute-locale-route)

PHPackages © 2026

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