PHPackages                             vrnvgasu/localization - 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. vrnvgasu/localization

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

vrnvgasu/localization
=====================

The simple button for localization changing.

0.1.0(5y ago)015[2 PRs](https://github.com/vrnvgasu/localization/pulls)MITPHPPHP ^7.2.5

Since Jul 16Pushed 3y ago1 watchersCompare

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

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

Localization
============

[](#localization)

A simple button for changing language for Laravel projects.

Russian and English are supported by default. But you can expand localization.

Installation
------------

[](#installation)

#### Install library

[](#install-library)

```
composer require vrnvgasu/localization

```

#### Except encrypting localization cookie

[](#except-encrypting-localization-cookie)

Add middleware cookie name `\Vrnvgasu\Localization\Services\Locale\Locale::USER_LOCALE`to `$except` array for \\App\\Http\\Middleware\\EncryptCookies if you use this middleware.

```
namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
use Vrnvgasu\Localization\Services\Locale\Locale;

class EncryptCookies extends Middleware
{
    protected $except = [
        Locale::USER_LOCALE,
    ];
}
```

#### Run migrations

[](#run-migrations)

By default, a locale column will be added to the users table. If this column exists, no migration is required. If the user table is named differently, then you need to make changes to the configs (detailed description in configuring the configs).

```
php artisan migrate

```

#### Set middleware

[](#set-middleware)

Set middleware for routes that support localization.

```
use Illuminate\Support\Facades\Route;
use Vrnvgasu\Localization\Middleware\Localization;

Route::group(array(
    'middleware' => Localization::ALIAS,
), function() {
    //
});
```

#### Config management

[](#config-management)

Publish config to your project

```
php artisan vendor:publish --tag=vrnvgasu_localization__config

```

The `config/vrnvgasu_localization.php` will be published.

Then you can add new locales in `locales` array:

```
    'locales' => [
        'en' => [
            'lang' => 'lang',
            'name' => 'en',
        ],
        'ru' => [
            'lang' => 'яз',
            'name' => 'рус',
        ],
        'new_locale' => [
            'lang' => 'drop_down_button_name',
            'name' => 'language_name',
        ],
    ],
```

Change default locale:

```
'default' => 'new_locale',
```

Change users table name (is necessary for migration):

```
'users_table' => 'users_table_name',
```

#### Include language button

[](#include-language-button)

Use `@include('vrnvgasu::localization.index')` in your blade.

```

            @include('vrnvgasu::localization.index')

```

#### View management

[](#view-management)

Publish view to your project

```
php artisan vendor:publish --tag=vrnvgasu_localization__view

```

The `resources/views/vendor/vrnvgasu/localization/index.blade.php`will be published.

You can change this view. `@include('vrnvgasu::localization.index')` will use your template.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

2127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e142dd81ca7c03ff8c52cd1bd7df74ed482ca9d245d7f7655e5821e6462f7bd?d=identicon)[vrnvgasu](/maintainers/vrnvgasu)

### Embed Badge

![Health badge](/badges/vrnvgasu-localization/health.svg)

```
[![Health](https://phpackages.com/badges/vrnvgasu-localization/health.svg)](https://phpackages.com/packages/vrnvgasu-localization)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[illuminate/routing

The Illuminate Routing package.

1238.6M2.3k](/packages/illuminate-routing)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)

PHPackages © 2026

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