PHPackages                             igorianru/laravel-language - 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. igorianru/laravel-language

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

igorianru/laravel-language
==========================

Multilingual routes and language switcher for laravel 5

02PHP

Since Oct 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/igorianru/laravel-language)[ Packagist](https://packagist.org/packages/igorianru/laravel-language)[ RSS](/packages/igorianru-laravel-language/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel language
================

[](#laravel-language)

Multilingual routes and language switcher for laravel 5

Installation
============

[](#installation)

The preferred way to install extension is via composer. Check the composer.json for this extension's requirements and dependencies.

To install, either run

```
$ php composer.phar require igorianru/laravel-language "*"
```

or add

```
"igorianru/laravel-language": "*"
```

to the require section of your composer.json.

Configuration
=============

[](#configuration)

After installing the Socialite library, register the igorianru\\language\\LanguageServiceProvider in your `config/app.php` configuration file:

```
'providers' => [
    // Other service providers...
    igorianru\language\LanguageServiceProvider::class,
],
```

Also, add the Language facade to the aliases array in your app configuration file:

```
'Language' => igorianru\language\LanguageFacade::class,
```

Usage
=====

[](#usage)

Use `Language::getLocale()` method to add language prefix to your routes:

```
Route::group(['prefix' => Language::getLocale()], function () {
    Route::get('/home', function () {
        return view('frontend.index');
    })->name('home');
});
```

Use `Language::renderDropdownList()` in your view-file to generate language dropdown list (note a exclamation marks):

```
{!! Language::renderDropdownList() !!}
```

This method takes 'locales' array which specified in you `app.config` file. It assumes that each 'locale' item key is a language 'code' and value is a 'visible\_name'. You can control language item label content via `Language::renderDropdownList()` $label\_template value:

```
{!! Language::renderDropdownList('{visible_name} ({code})') !!}
```

Label will look like this: `'English (en)'`You can add additional items to any 'locale' item value and render that value in `Language::renderDropdownList()`. For example, if you added 'description' and your `app.config` looks something like this:

```
'locales' => [
    'en' => [
        'visible_name' => 'English',
        'description' => 'Some simple text'
    ],
    'ru' => 'Русский',
]
```

You can render 'description' item:

```
{!! Language::renderDropdownList('{visible_name} ({code}) {description}') !!}
```

Label will look like this: `'English (en) Some simple text'`

Customization
=============

[](#customization)

You can customize html of language dropdown list. Simply run `php ./artisan vendor:publish --tag=language` and edit `dropdown.blade.php` template in your `resources/views/vendor/language` directory.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/196a65c074ad0cce882629e7f22fec18689f9cf1bd7421d659675b4d91262513?d=identicon)[igorianru](/maintainers/igorianru)

---

Top Contributors

[![igorianru](https://avatars.githubusercontent.com/u/5312614?v=4)](https://github.com/igorianru "igorianru (14 commits)")[![aayaresko](https://avatars.githubusercontent.com/u/8190713?v=4)](https://github.com/aayaresko "aayaresko (2 commits)")

### Embed Badge

![Health badge](/badges/igorianru-laravel-language/health.svg)

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

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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