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(12mo ago)212MITPHPPHP ^8.4

Since Apr 29Pushed 12mo 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 1mo ago

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

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

364d ago

### Community

Maintainers

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

[askdkc/breezejp

Laravel Starter Kit (Livewire+Breeze+Laravel UI+Jetstream)や標準のバリデーションメッセージを全て一瞬で日本語化し、言語切替機能も提供するパッケージです / This package provides all-in-one Japanese translation for Laravel StarterKit (Livewire StarterKit, Breeze, Laravel UI and Jetstream) packages and validation messages with language switching feature.

590244.8k1](/packages/askdkc-breezejp)[statikbe/laravel-filament-chained-translation-manager

A translation manager tool for Laravel Filament, that makes use of the Laravel Chained Translator.

92108.7k](/packages/statikbe-laravel-filament-chained-translation-manager)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[elegantly/laravel-translator

All on one translations management for Laravel

6216.9k](/packages/elegantly-laravel-translator)[andrewdwallo/transmatic

Automate and streamline real-time text translations in your Laravel applications

5511.6k](/packages/andrewdwallo-transmatic)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2266.3k](/packages/smousss-laravel-globalize)

PHPackages © 2026

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