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

AbandonedArchivedLibrary

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

Flexible Laravel translator

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

Since Jan 8Pushed 7y ago3 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 today

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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

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

2854d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f60b615dc3f4e8de66d73706683579b9e519b52bbca13b2ff8e8bf5179ab3313?d=identicon)[Hokan22](/maintainers/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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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