PHPackages                             marciojc/language-switch - 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. marciojc/language-switch

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

marciojc/language-switch
========================

A Laravel Package to switch language

1.0.0(9y ago)113MITPHP

Since Apr 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/marciojc/language-switch)[ Packagist](https://packagist.org/packages/marciojc/language-switch)[ RSS](/packages/marciojc-language-switch/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Language Switch
===============

[](#language-switch)

Website &amp; Documentation:

---

After creating your new Laravel application you can include the LanguageSwitch package with the following command:

```
composer require marciojc/language-switch
```

Add the LanguageSwitch service provider to the `config/app.php` file in the `providers` array:

```
'providers' => [
    // Laravel Framework Service Providers...
    //...

    // Package Service Providers
    marciojc\LanguageSwitch\LanguageSwitchServiceProvider::class,
    // ...

    // Application Service Providers
    // ...
],
```

Now, you can use LanguageSwitch, like this

```

  @if (App::getLocale() == 'pt')
    {{ trans('common.en') }}
  @else
    {{ trans('common.pt') }}
  @endif

```

When your route use some id or slug, you must say what model to use

```
Route::get(trans('routes.news') . '/{slug}' , [
  'as'           => 'newsdetails',
  'uses'         => 'NewsController@details',
  'model'        => 'App\News'
]);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Unknown

Total

1

Last Release

3302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4fce8663526a9f551c783c16e3a13348767c6f16c5f4998f3bfe116efe073a9?d=identicon)[marciojc](/maintainers/marciojc)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marciojc-language-switch/health.svg)

```
[![Health](https://phpackages.com/badges/marciojc-language-switch/health.svg)](https://phpackages.com/packages/marciojc-language-switch)
```

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.6M17](/packages/barryvdh-laravel-translation-manager)[vluzrmos/language-detector

Detect the language for your application using browser preferences, subdomains or route prefixes.

109554.8k3](/packages/vluzrmos-language-detector)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[highsolutions/laravel-translation-manager

Manage Laravel Translations

1518.8k](/packages/highsolutions-laravel-translation-manager)[amendozaaguiar/laraveles-spanish-for-jetstream

Archivos de traducción al español latinoamericano para Laravel con Jetstream (auth, pagination, passwords, validation + todas las cadenas de Jetstream).

1412.1k](/packages/amendozaaguiar-laraveles-spanish-for-jetstream)

PHPackages © 2026

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