PHPackages                             aw-studio/localize - 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. aw-studio/localize

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

aw-studio/localize
==================

Translated Routes for Fjord Frontends

v0.3(5y ago)1137MITPHP

Since Apr 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/aw-studio/localize)[ Packagist](https://packagist.org/packages/aw-studio/localize)[ RSS](/packages/aw-studio-localize/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Localize – Translated Routes for Fjord Frontends
================================================

[](#localize--translated-routes-for-fjord-frontends)

Build translated routes in the form of `/en/home`, `/de/startseite` made easy.

Install
-------

[](#install)

```
composer require aw-studio/localize
```

Usage
-----

[](#usage)

Make shure to translate your routes within your translation-files in the `resources` directory, e.g.:

```
// lang/de/routes.php

return [
    'home' => 'startseite'
];
```

You can now simply add translated Routes to your preferred routes file, e.g. `routes\web.php`:

```
Route::trans('/__(routes.home)', HomeController::class)->name('home');
```

Translated Routes in Blade
--------------------------

[](#translated-routes-in-blade)

In your blade-files, simply use the `__route()` helper like this:

```

    ...

```

### Switching languages

[](#switching-languages)

Use the `__routes()` helper to retrieve an array of routes to all language versions of the current route. If your route uses translated parameters these need to be passed.

```
@foreach (__routes($routeParameters ?? null) as $route)

        {{ $route->locale }}

@endforeach
```

Translated Route Parameters
---------------------------

[](#translated-route-parameters)

Imagine your route takes a translated slug as a parameter, a blog post for example:

`/en/posts/my-first-post``/de/beitraege/mein-erster-beitrag`

Your route should look something like this:

```
Route::trans('/__(routes.posts)/{slug}', PostController::class)->name('posts.show');
```

In your controller, you can retrieve the post using the `whereHas` method

```
$post = Post::whereHas('translations', function($query) use($slug) {
        $query->where('slug', $slug)->where('locale', app()->getLocale());
    })
    ->with('translations')
    ->first();
```

In order to retrieve the post's links to all other languages, we have pass the translated route parameters like this:

```
$slugs = $post->translations->mapWithKeys(function($item) {
    return [$item->locale => $item->slug];
})->toArray();

return view('posts.show')->with([
    'post' => $post,
    'routeParameters' => ['slug' => $slugs]
]);
```

In your view you can now use the `__routes()` function passing it the relevant parameters:

```
@foreach (__routes($routeParameters ?? null) as $route)
    {{ $route->link }}
@endforeach
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Total

3

Last Release

2163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b2d65d58480dd7fdbf4f4593158cbd0634550ee9210c49957cc48c8a8ccaef6?d=identicon)[jannescb](/maintainers/jannescb)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/aw-studio-localize/health.svg)

```
[![Health](https://phpackages.com/badges/aw-studio-localize/health.svg)](https://phpackages.com/packages/aw-studio-localize)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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