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

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

dnt/localization
================

Localization for laravel

v1.3(2y ago)0173MITPHPPHP ^7.4|^8.0

Since Aug 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ducconit/localization)[ Packagist](https://packagist.org/packages/dnt/localization)[ Docs](https://github.com/ducconit/localization)[ RSS](/packages/dnt-localization/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

Laravel Localization
--------------------

[](#laravel-localization)

*Coded by Trung đức*

### Cài đặt

[](#cài-đặt)

`composer require dnt/localization`

### Xóa

[](#xóa)

`composer remove dnt/localization`

### Cách dùng

[](#cách-dùng)

Đặt các router của bạn vào trong scope `Route::localization()`

Ví dụ:

```
// routes/web.php
use Illuminate\Support\Facades\Route;

Route::localization(function(){
    Route::get('/',function(){
        return view('welcome');
    })
})
```

Phương thức này sẽ tự động chuyển ngôn ngữ cho dự án

Với kiểu route trên nó sẽ tạo ra các uri tương ứng với ngôn ngữ được hỗ trợ:

như ví dụ trên:

```
/
/en
/vi

```

- Bạn có thể gọi route với các định danh là các locale bạn đã khai báo trong config

```
route('index');// ngôn ngữ hiện tại
route('vi.index');// ngôn ngữ tiếng việt
route('en.index');// ngôn ngữ tiếng anh
```

- Package này hỗ trợ sẵn cho bạn 1 route chuyển đổi ngôn ngữ mặc định:
- Đầu tiên hãy gán đoạn mã sau vào routes/web.php

```
Route::locale();
```

```
route('localization::changeLocale');
uri (GET): /change-locale/{locale}
// {locale} có thể thay thế bằng cách truyền param (ajax, axios)
vd:
$.ajax('{{ route('localization::changeLocale') }}',{
    data: {
        locale:'vi'
    }
})
hoặc
axios.get('{{ route('localization::changeLocale') }}',{
    params: {
      locale:'en'
    }
  });
```

[![](/art/example-route.png)](/art/example-route.png)

### Chiết xuất file config

[](#chiết-xuất-file-config)

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~195 days

Total

5

Last Release

999d ago

PHP version history (2 changes)v1.0PHP ^7.3|^8.0

v1.3PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/72369814?v=4)[DNT](/maintainers/ducconit)[@ducconit](https://github.com/ducconit)

---

Top Contributors

[![ducconit](https://avatars.githubusercontent.com/u/72369814?v=4)](https://github.com/ducconit "ducconit (6 commits)")

---

Tags

localizationlocationdntroute localizationlaravel locationducconit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k13](/packages/laravel-surveyor)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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