PHPackages                             hokan22/laravel-translator - 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. hokan22/laravel-translator

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

hokan22/laravel-translator
==========================

Flexible Laravel translator

v1.3.3(7y ago)12071MITPHPPHP &gt;=5.5.9

Since Jan 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/Hokan22/laravel-translator)[ Packagist](https://packagist.org/packages/hokan22/laravel-translator)[ Docs](https://github.com/hokan22/laravel-translator)[ RSS](/packages/hokan22-laravel-translator/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (5)Versions (24)Used By (0)

Laravel Translator
==================

[](#laravel-translator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9a7b9acb1ff3844c0fd21a51d7e46f90fce2d77e493303b9d3d0699f5a6ac093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f6b616e32322f6c61726176656c2d7472616e736c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hokan22/laravel-translator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/56e4dc204b10817d822c631ef6d1fc9e85155306bb6b90c531408f0b53bbef93/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f686f6b616e32322f6c61726176656c2d7472616e736c61746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hokan22/laravel-translator)

Install
-------

[](#install)

Via Composer

```
$ composer require hokan22/laravel-translator
```

Setup
-----

[](#setup)

Add the service provider to the providers array in `config/app.php`.

```
'providers' => [
    Hokan22\LaravelTranslator\Provider\TranslatorProvider::class,
    Hokan22\LaravelTranslator\Provider\TranslatorBladeProvider::class,
];
```

Additionally you might want to add an alias to the aliases array within the `config/app.php` file.

```
'aliases' => [
    'Translator' => Hokan22\LaravelTranslator\TranslatorFacade::class,
];
```

Middleware
----------

[](#middleware)

You may want to use the middleware in order to control the global language setup inside `app/Http/Kernel.php`.

```
protected $routeMiddleware = [
    'translator' => \Hokan22\LaravelTranslator\Middleware\TranslatorMiddleware::class,
];
```

Publishing
----------

[](#publishing)

You can publish the configuration with:

```
php artisan vendor:publish --provider="Hokan22\LaravelTranslator\Provider\TranslatorProvider"
```

Usage
-----

[](#usage)

This Package provides an easily extendable translation function with parameters for laravel.

After you registered the TranslatorBladeServiceProvider you can use the `@t()` or `@translate()` blade directives to translate your website into different languages. You can define a locale through the translator middleware or define a locale for each translation individually.

```
@t('Hello World!')
@t('Hello {name}!', ['name' => World], 'de_DE')
@t('Hello World', [], 'fr_FR')

```

### Parameters

[](#parameters)

Parameters are simply surrounded by `{}` and their replacement provided as an array as the second parameter of the blade translate directive.

```
@t('Visit the site {link}.', ['link' => 'Example.com'])

```

### Custom Locales

[](#custom-locales)

If you use a different locale schema, just change the `available_locales` array in the config file.

### Custom Translation Handler

[](#custom-translation-handler)

To use your custom Translation Handler make sure it implements the Interface: `Hokan22\LaravelTranslator\Handler\HandlerInterface.php`Now just change the 'handler' config parameter in `config\translator.php` to your custom Handler class.

```
'handler' =>  Hokan22\LaravelTranslator\Handler\DatabaseHandler::class,
```

### Custom Translation Routes

[](#custom-translation-routes)

By default the Translator admin Interface is reachable under `/translator/admin`. To override the default routes change the `custom_routes` parameter in the config to `true` and define the routes as you need them. NOTE: In Order to use the "Live Mode" make sure you give the route to `TranslatorAdminController@edit` the name: `'translator.admin.edit'`.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~9 days

Recently: every ~21 days

Total

21

Last Release

2904d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9664468?v=4)[Alexander](/maintainers/Hokan22)[@Hokan22](https://github.com/Hokan22)

---

Top Contributors

[![Hokan22](https://avatars.githubusercontent.com/u/9664468?v=4)](https://github.com/Hokan22 "Hokan22 (103 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

laravellanguagetranslatormultilanghokan22

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hokan22-laravel-translator/health.svg)

```
[![Health](https://phpackages.com/badges/hokan22-laravel-translator/health.svg)](https://phpackages.com/packages/hokan22-laravel-translator)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.8k](/packages/larastan-larastan)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k43.2M609](/packages/spatie-laravel-medialibrary)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M169](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20432.6M1.5k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

87511.3M154](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)

PHPackages © 2026

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