PHPackages                             iammarjamal/inertiatrans - 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. iammarjamal/inertiatrans

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

iammarjamal/inertiatrans
========================

simple translation sync between Laravel and any frontend framework.

1.0.2(1y ago)212MITPHPPHP ^8.4

Since Apr 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iammarjamal/inertiaTrans)[ Packagist](https://packagist.org/packages/iammarjamal/inertiatrans)[ Docs](https://github.com/iammarjamal/inertiatrans)[ RSS](/packages/iammarjamal-inertiatrans/feed)WikiDiscussions main Synced today

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

 [![InertiaTrans](https://camo.githubusercontent.com/9c240e69cc3e970b1e74277bfbde57be65ab75f0cf361dde246dea3031eb9736/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f696e65727469615472616e732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d69616d6d61726a616d616c253246696e65727469617472616e73267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d73696d706c652b7472616e736c6174696f6e2b73796e632b6265747765656e2b4c61726176656c2b616e642b616e792b66726f6e74656e642b6672616d65776f726b2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313530707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/9c240e69cc3e970b1e74277bfbde57be65ab75f0cf361dde246dea3031eb9736/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f696e65727469615472616e732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d69616d6d61726a616d616c253246696e65727469617472616e73267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d73696d706c652b7472616e736c6174696f6e2b73796e632b6265747765656e2b4c61726176656c2b616e642b616e792b66726f6e74656e642b6672616d65776f726b2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313530707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

Overview
--------

[](#overview)

**InertiaTrans** is a Laravel package that synchronizes your Laravel translation files with any JavaScript front-end framework. Continue to maintain your translations in `lang/**` as usual, and InertiaTrans will convert them into a JavaScript-friendly format on each page load.

Requirements
------------

[](#requirements)

- **Laravel** `^12`
- **Node.js** `^20`

🚀 Installation
--------------

[](#-installation)

1. Install via Composer: ```
    composer require iammarjamal/inertiatrans
    ```
2. Publish and install the NPM dependencies: ```
    php artisan inertiaTrans:install
    ```

📚 Usage
-------

[](#-usage)

### 1. Add the Blade directive

[](#1-add-the-blade-directive)

In your main Blade layout (e.g. `resources/views/app.blade.php`), include the `@inertiaTrans` directive inside ``:

```

    {{ config('app.name', 'Laravel') }}

    @viteReactRefresh
    @vite([
        'resources/js/app.jsx',
        "resources/js/pages/{$page['component']}.jsx"
    ])
    @inertiaHead

    {{-- Include translations as a JS object --}}
    @inertiaTrans

    @inertia

```

### 2. Use translations in your front-end

[](#2-use-translations-in-your-front-end)

#### React Example

[](#react-example)

```
import { __, trans } from 'inertia-translations';

export default function Welcome() {
  return (

        { trans("app.HelloWorld") }

        { __("app.HelloWorld") }

  );
}
```

#### Vue Example

[](#vue-example)

```

import { __, trans } from 'inertia-translations';

    {{ trans("app.HelloWorld") }}
    {{ __("app.HelloWorld") }}

```

🔍 How It Works
--------------

[](#-how-it-works)

1. **Laravel translations**

    - You keep your translation files in `lang/**` as usual.
    - The `@inertiaTrans` directive gathers them and injects a single JavaScript object into your page.
2. **Caching in Production**

    - In `APP_ENV=production`, translations are cached for performance.
    - After updating any translation file, run: ```
        php artisan optimize:clear
        ```

        to clear the cache and load the latest strings.

✨ Credits
---------

[](#-credits)

- **Creator:** [iammarjamal](https://github.com/iammarjamal)

📄 License
---------

[](#-license)

This package is released under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance46

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

3

Last Release

419d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64818319?v=4)[Ammar | عمار](/maintainers/iammarjamal)[@iammarjamal](https://github.com/iammarjamal)

---

Top Contributors

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

---

Tags

laraveliammarjamalinertiatrans

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/iammarjamal-inertiatrans/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M102](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[elegantly/laravel-translator

All on one translations management for Laravel

6333.1k](/packages/elegantly-laravel-translator)

PHPackages © 2026

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