PHPackages                             niels-numbers/laravel-localizer - 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. niels-numbers/laravel-localizer

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

niels-numbers/laravel-localizer
===============================

Detects the user’s preferred language and redirects to the matching localized URL.

v1.3.3(1w ago)171.4k↑55.6%2[1 issues](https://github.com/niels-numbers/laravel-localizer/issues)MITPHPPHP ^8.2CI passing

Since Apr 30Pushed 1w ago1 watchersCompare

[ Source](https://github.com/niels-numbers/laravel-localizer)[ Packagist](https://packagist.org/packages/niels-numbers/laravel-localizer)[ RSS](/packages/niels-numbers-laravel-localizer/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

Laravel Localizer
=================

[](#laravel-localizer)

[![Tests](https://github.com/niels-numbers/laravel-localizer/actions/workflows/tests.yml/badge.svg)](https://github.com/niels-numbers/laravel-localizer/actions/workflows/tests.yml)[![PHP](https://camo.githubusercontent.com/91c32053ff9bef6ba397e97fb6224bdb85a98947e8a7b3555a8c76cb655d16a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e32253230253743253230382e33253230253743253230382e342d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/91c32053ff9bef6ba397e97fb6224bdb85a98947e8a7b3555a8c76cb655d16a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e32253230253743253230382e33253230253743253230382e342d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)[![Laravel](https://camo.githubusercontent.com/196b502027eb7414bad1a8db02f9e214e8b18b36bc15ea8456361dcc53e0d0af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3925323025374325323031302532302537432532303131253230253743253230313225323025374325323031332d626c75653f6c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/196b502027eb7414bad1a8db02f9e214e8b18b36bc15ea8456361dcc53e0d0af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3925323025374325323031302532302537432532303131253230253743253230313225323025374325323031332d626c75653f6c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)

> Successor to [`mcamara/laravel-localization`](https://github.com/mcamara/laravel-localization). Static routes, `route:cache` ready.

Locale-aware routing for Laravel: auto-detect, auto-redirect, and resolve `route()` per language.

**Documentation: [localizer.adam-nielsen.de](https://localizer.adam-nielsen.de)**

Example
-------

[](#example)

```
Route::localize(function () {
    Route::get('/about', AboutController::class)->name('about');
});
```

Produces:

- `/about` - this endpoint carries the package's core magic: auto-detection, redirect, or default locale (see below)
- `/de/about`, `/fr/about`, ... for every other configured locale

Every route is registered **twice** as a static route:

```
GET|HEAD  about ............... without_locale.about › AboutController
GET|HEAD  {locale}/about .......... with_locale.about › AboutController

```

In your application code, keep using `route('about')`; the package picks the right variant based on the current locale.

How `/about` resolves at request time:

1. **First visit**: the package reads the `Accept-Language` header (or your own detector chain) and redirects to the matching localized URL.
2. **Subsequent visits**: an explicit URL prefix always wins. Without a URL signal, the locale is taken from the session and cookie. The user is redirected to the prefixed variant unless their locale matches the default and `hide_default_locale` is on - in which case they are redirected or stay on `/about`.
3. **Fallback**: when no signal matches, the configured default locale is used.

> **Note**: a switcher link to plain `/about` carries no locale signal - `RedirectLocale` would send the user back to their session locale instead of switching. See [Language Switcher](https://localizer.adam-nielsen.de/language-switcher) for more.

Install
-------

[](#install)

```
composer require niels-numbers/laravel-localizer
```

[Setup guide](https://localizer.adam-nielsen.de/installation) · [Migrating from `mcamara/laravel-localization`?](https://localizer.adam-nielsen.de/migrating-from-laravel-localization)

License &amp; credits
---------------------

[](#license--credits)

MIT licensed. Created by Adam Nielsen, building on prior work by [@mcamara](https://github.com/mcamara) (original `laravel-localization`), [@codezero-be](https://github.com/codezero-be) (deprecated `laravel-localized-routes`, whose static-route ideas inspired this rewrite) and [@jordyvanderhaegen](https://github.com/jordyvanderhaegen) (current maintainer of the original, whose [issue #921](https://github.com/mcamara/laravel-localization/issues/921)motivated this package).

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance97

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.3% 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 ~2 days

Total

13

Last Release

13d ago

Major Versions

v0.10.0 → v1.0.02026-05-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/e71a4afe1563926ed376742f4fa4ee2cadb863b088445b939af5435b29499aae?d=identicon)[niels-numbers](/maintainers/niels-numbers)

---

Top Contributors

[![niels-numbers](https://avatars.githubusercontent.com/u/1765602?v=4)](https://github.com/niels-numbers "niels-numbers (118 commits)")[![michaelnabil230](https://avatars.githubusercontent.com/u/46572405?v=4)](https://github.com/michaelnabil230 "michaelnabil230 (2 commits)")

---

Tags

i18ninternationalizationlaravel-packagelocalelocale-detectionmultilingualphproutingtranslationphplaravellocalizationlanguageroutestranslationroutinglocalecountry

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/niels-numbers-laravel-localizer/health.svg)

```
[![Health](https://phpackages.com/badges/niels-numbers-laravel-localizer/health.svg)](https://phpackages.com/packages/niels-numbers-laravel-localizer)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543656.8k4](/packages/codezero-laravel-localized-routes)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

30109.8k1](/packages/opgginc-codezero-laravel-localized-routes)[codezero/laravel-localizer

Automatically detect and set an app locale that matches your visitor's preference.

50401.1k4](/packages/codezero-laravel-localizer)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.5k1](/packages/longman-laravel-multilang)

PHPackages © 2026

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