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

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

erykai/translate
================

Component for all language translation, system messages and routes, and translation for laravel resources/lang/en

v3.0.1(2y ago)01492MITPHPPHP &gt;=8.0

Since Aug 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Erykai/translate)[ Packagist](https://packagist.org/packages/erykai/translate)[ GitHub Sponsors](https://github.com/Erykai)[ RSS](/packages/erykai-translate/feed)WikiDiscussions main Synced today

READMEChangelog (10)DependenciesVersions (16)Used By (2)

Translate
=========

[](#translate)

[![Maintainer](https://camo.githubusercontent.com/8d0c30a6e6bb0e588086373acb7d3cb9c1ff2135f91a52d1a7a99a8670aa1090/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d40616c657864656f766964616c2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://instagram.com/alexdeovidal)[![Source Code](https://camo.githubusercontent.com/21414c489c43bc3f5c5069dfe0c731d2961c3d5904060bd5c77800a28a199ca4/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d6572796b61692f7472616e736c6174652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/erykai/translate)[![PHP from Packagist](https://camo.githubusercontent.com/4239e6569d2ef467d46bc37753d568e3135c60b8eebe034343c752f34df18528/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6572796b61692f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erykai/translate)[![Latest Version](https://camo.githubusercontent.com/45723c098dcab246f3b967fc7fa4f8db2329a70c596f2ecb257c363ca012ef18/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6572796b61692f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://github.com/erykai/translate/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Quality Score](https://camo.githubusercontent.com/f334dc827c90571a7222ae157e2493cdd5b81bca9bb18305b7a6ccb6e3f3d922/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6572796b61692f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/erykai/translate)[![Total Downloads](https://camo.githubusercontent.com/6bf89b20f4b720ab2d02dc940506fbebf659c993e54dc25e7ef47d79fce57fd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6572796b61692f7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erykai/translate)

Component for all language translation, system messages and routes, and resources lang laravel

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

[](#installation)

Composer:

```
"erykai/translate": "3.0.*"
```

Terminal

```
composer require erykai/translate
```

Create config.php para erykia

```
const TRANSLATE_PATH = 'translate'; //Laravel 'php';
const TRANSLATE_DEFAULT = 'en';  //example: pt_BR, es ...
const TRANSLATE_API_URL = 'https://translate.erykia.com/api/v1';
const TRANSLATE_EXT = 'translate'; // Laravel 'translate/resources/lang';
const TRANSLATE_API_KEY = '';
```

Translate define language -&gt;target("es") ou -&gt;target() default "en"

```
use Erykai\Translate\Translate;

require_once "config.php";
require_once "vendor/autoload.php";

$translate = new Translate();
$data = new stdClass();
$data->file = "route";
$data->text = "/send/{id}/{slug}"; // $data->text = "Hello"; if remove line 12
$data->dynamic = "/{id}/{slug}"; // off dynamic remove line string|array ['{id}','{slug}']
$translate->data($data)->target("es")->response();
```

Example translate resources lang laravel Copy the resources/lang/en/\*.php folder with all files to the root, then just run php index.php

```
use Erykai\Translate\Translate;

require_once "config.php";
require_once "vendor/autoload.php";
$translate = new Translate();

$dir = 'resources/lang/en/';
$files = array_diff(scandir($dir), array('..', '.'));

foreach ($files as $file) {
    if (pathinfo($file, PATHINFO_EXTENSION) == 'php') {
        $validationMessages = include $dir . $file;
        $filenameWithoutExtension = pathinfo($file, PATHINFO_FILENAME);
        $translate->processMessages($validationMessages, $translate, $filenameWithoutExtension,target:"pt_BR");
    }
}
```

Contribution
------------

[](#contribution)

All contributions will be analyzed, if you make more than one change, make the commit one by one.

Support
-------

[](#support)

If you find faults send an email reporting to .

Credits
-------

[](#credits)

- [Alex de O. Vidal](https://github.com/alexdeovidal) (Developer)
- [All contributions](https://github.com/erykai/translate/contributors) (Contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License](https://github.com/erykai/translate/LICENSE) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~81 days

Total

15

Last Release

994d ago

Major Versions

v1.0.5 → v2.0.02022-08-30

v2.2.3 → v3.0.02023-10-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1795fc67d400661b64ca8a84adeabe383f32b2925daed4d63ec0ef51f14837f?d=identicon)[alexdeovidal](/maintainers/alexdeovidal)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.8k](/packages/laradevs-spanish)

PHPackages © 2026

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