PHPackages                             in10/multilanguage - 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. in10/multilanguage

ActiveLibrary

in10/multilanguage
==================

Simple, opinionated multilanguage package for Laravel

v2.0.1(7mo ago)21.2k[1 PRs](https://github.com/IN10/multilanguage/pulls)proprietaryPHPPHP ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.1CI failing

Since Jan 23Pushed 7mo ago7 watchersCompare

[ Source](https://github.com/IN10/multilanguage)[ Packagist](https://packagist.org/packages/in10/multilanguage)[ RSS](/packages/in10-multilanguage/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (24)Used By (0)

IN10 Multilanguage
==================

[](#in10-multilanguage)

> Simple, opinionated multilanguage package for Laravel

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Design](#design)
- [Installation](#installation)
- [Migrating from Arcanedev/localization](#migrating-from-arcanedevlocalization)
- [Usage](#usage)
- [Developer](#developer)
- [License](#license)

Requirements
------------

[](#requirements)

- PHP 7.1 - 7.3
- Laravel 5.7

Design
------

[](#design)

This is an opinionated package: it works in a specific way, based on the setups we run at IN10. That means:

1. All translated routes start with a route part, e.g. example.com/de/news/
2. A website has a pre-defined set of languages, all other languages return a 404.
3. A language is always two characters.
4. The homepage is translated.
5. The website has a single default language, by default "en" which you can change in the configuration. This default language is excluded from the URL via a 301-redirect. If you visit example.com/en/test, it will be redirected to example.com/test.

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

[](#installation)

Install the package using composer:

```
composer require "in10/multilanguage"
```

and publish the configuration file:

```
php artisan vendor:publish --provider=IN10\\Multilanguage\\ServiceProvider
```

You can customize this file as needed.

Migrating from ARCANEDEV/localization
-------------------------------------

[](#migrating-from-arcanedevlocalization)

One of the packages we used to use at IN10 is [ARCANEDEV/Localization](https://github.com/arcanedev/localization). To facilitate an easy upgrade from the package to this new, smaller package, execute the following steps:

1. Remove the existing package: `composer remove arcanedev/localization`.
2. Remove the ServiceProvider and configuration file if needed.
3. Follow the steps in the [Installation](#installation) section above to install IN10/multilanguage.
4. Search through your project for the following instances of Localization-specific code that must be replaced

Search forReplace withRemarks`localization()->getCurrentLocale()``App::getLocale()`Don't forget to import the Facade`Localization::getCurrentLocale()``App::getLocale()`Don't forget to import the Facade`config('localization.supported-locales')``config('languages.supported-languages`5. Test your project thoroughly to check if all translated routes and features still work.

Usage
-----

[](#usage)

### Setting up groups

[](#setting-up-groups)

You can make a set of routes translated by wrapping them in a group:

```
Route::multilanguage([], function() {
    Route::get('/', 'HomepageController')->name('homepage');
    Route::get('/news/{slug}', 'HomepageController')->name('news.show');
});
```

The first parameter `attributes` takes the same settings as a regular route group, except for `prefix`, `as` and `middleware`, which are overwritten (these parameters are required to make the translation work). The multilanguage-group should be a root-level construct. Adding it inside of another group or prefix is not tested and probably won't work.

### Route translation

[](#route-translation)

In some cases, you might want to translate slugs in the URL. A common example is the `/en/news/an-article` and `/nl/nieuws/een-artikel` variants of URLs. This can be accomplished using the `transGet` routing function:

```
Route::multilanguage([], function() {
    Route::transGet('news.show');
});
```

Note that using `transGet` outside of a multilanguage routing group will not work.

The translation key is automatically looked up in the `routes.php` translation file. All translation routes must always be translated. Don't fret: the package will scream at you if you're missing a translation.

```
// resources/lang/en/routes.php
return [
    'news.show' => 'news/{slug}',
];

// resources/lang/nl/routes.php
return [
    'news.show' => 'nieuws/{slug}',
];
```

### Route generation

[](#route-generation)

If you want to generate a route with a correct language, use the included helper:

```
function translatedRoute(string $route, array $parameters = [], bool $absolute = true, ?string $language = null) : string
```

This helpers takes the same parameters as the Laravel `route()` helper, with an optional language as a last parameter. If you omit the language, the helper uses the current language for the request. This is usually what you want, so in general you can use the translatedRoute helper as if it were the regular helper:

```
translatedRoute('news.show', ['slug' => 'five-ways-to-translate-content');
```

which will generate `/nl/news/five-ways-to-translate-content` in this example if the current language is set to Dutch.

Developer
---------

[](#developer)

[Jakob Buis](https://www.jakobbuis.nl)

License
-------

[](#license)

Copyright 2019 [IN10](https://www.in10.nl). All rights reserved.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance64

Regular maintenance activity

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 86% 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 ~143 days

Recently: every ~413 days

Total

18

Last Release

219d ago

Major Versions

v1.2.0-alpha.3 → v2.0.0-alpha.12021-10-15

PHP version history (4 changes)v1.0.0-alpha.1PHP ^7.3

v1.0.0-alpha.2PHP ^7.1 || ^7.2 || ^7.3

v2.0.0-alpha.1PHP ^7.1 || ^7.2 || ^7.3 || ^7.4

v2.0.1PHP ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d23630df3f8e70e643fd7215276c71d3a48e60c573cea555fa28ddba0da7087?d=identicon)[stephandebruin](/maintainers/stephandebruin)

---

Top Contributors

[![jakobbuis](https://avatars.githubusercontent.com/u/949674?v=4)](https://github.com/jakobbuis "jakobbuis (37 commits)")[![stephandebruin](https://avatars.githubusercontent.com/u/22237643?v=4)](https://github.com/stephandebruin "stephandebruin (5 commits)")[![agoudsmit](https://avatars.githubusercontent.com/u/339679?v=4)](https://github.com/agoudsmit "agoudsmit (1 commits)")

### Embed Badge

![Health badge](/badges/in10-multilanguage/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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