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(6y 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 yesterday

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 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

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

2222d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32741644?v=4)[Dmitrii](/maintainers/vrnvgasu)[@vrnvgasu](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[illuminate/routing

The Illuminate Routing package.

1239.4M3.5k](/packages/illuminate-routing)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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