PHPackages                             escuccim/translate - 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. escuccim/translate

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

escuccim/translate
==================

A Laravel translation/localization package

v0.1.0-beta.4(7y ago)033MITPHPPHP ~5.6|~7.0

Since Jan 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/escuccim/translate)[ Packagist](https://packagist.org/packages/escuccim/translate)[ Docs](https://github.com/escuccim/translate)[ RSS](/packages/escuccim-translate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

translate
=========

[](#translate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a385fad7b728a8237693ab83fbd0c695d55320c96d0086a7992e3085d0f808b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657363756363696d2f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/escuccim/translate)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/a8f7ce17a7655471ab81f05a0852f7c971dea0444145916e67fb4cb0ed35b3e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657363756363696d2f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/escuccim/translate)

A package to enable localization for Laravel on either a subdomain basis or from the session.

Install
-------

[](#install)

Via Composer

```
$ composer require escuccim/translate
```

Register the service provider in /config/app.php 'providers' array:

```
Escuccim\Translate\TranslateServiceProvider::class,
```

Register the middleware in /app/Http/Kernel.php in the 'web' array of the $middlewareGroups array:

```
'web' => [
    ...
     \Escuccim\Translate\Http\Middleware\SetLanguage::class,
],
```

Make sure that the middleware is after the StartSession middleware if you wish to use session based translation.

Publish the config file with

```
php artisan vendor:publish
```

This will place the config file in /config/translate.php.

Usage
-----

[](#usage)

The config files has the following keys:

- use\_subdomain - boolean - whether you wish to use subdomain based translation
- languages - array of languages as follows - 'language' =&gt; 'display', where language is the language and display is how you want to display the language in the drop-down menu, if you use it.
- subdomains - array of languages: 'subdomain' =&gt; 'language'. This is used by the middleware to map the subdomain to the language setting
- date\_formats - array of date formats for strftime: 'language' =&gt; 'locale', where locale is the format of the dates you wish to use. Note that you must have the date formats installed on your web server for this to work properly. The default locale is en\_US\_POSIX.

I also include a route: /setlang/{lang} Which sets a session variable to {lang} which will override the subdomain if it is set.

Lastly I include a function to output a Bootstrap drop-down menu which will use the data in the languages key of the config to generate links to set the language in session. This can be accessed with \\Escuccim\\Translate\\TranslateClass::dropDown().

The middleware will first check if subdomain based translation is on, if so it will set the application locale to whatever is specified for the subdomain in the config file. Then if a session variable called 'locale' exists it will override the locale to correspond to the session. This allows you to default to a locale based on subdomain, but then have the user override this if they wish.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Eric Scuccimarra](https://github.com/escuccim)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

4

Last Release

2884d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravellocalizationtranslateescuccim

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/escuccim-translate/health.svg)

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

###  Alternatives

[outhebox/laravel-translations

Manage your Laravel translations with a beautiful UI. Add, edit, delete, import, and export translations with ease.

81396.3k](/packages/outhebox-laravel-translations)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4821.5k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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