PHPackages                             codecng/laravel-inertia-translations - 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. codecng/laravel-inertia-translations

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

codecng/laravel-inertia-translations
====================================

Provides translations for an Inertia Based Project

1.2.1(1mo ago)3466MITPHPPHP ^8.3 || ^8.4 || ^8.5CI passing

Since Feb 13Pushed 1mo agoCompare

[ Source](https://github.com/codecng/laravel-inertia-translations)[ Packagist](https://packagist.org/packages/codecng/laravel-inertia-translations)[ Docs](https://github.com/codecng/laravel-inertia-translations)[ GitHub Sponsors](https://github.com/CodeCNG)[ RSS](/packages/codecng-laravel-inertia-translations/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (18)Versions (8)Used By (0)

Laravel Inertia Translations
============================

[](#laravel-inertia-translations)

[![Latest Version on Packagist](https://camo.githubusercontent.com/419992187174fddf6f1b942b15df872b3bb0c19d9122e288bd5657265a8e9c71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6465636e672f6c61726176656c2d696e65727469612d7472616e736c6174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codecng/laravel-inertia-translations)[![Total Downloads](https://camo.githubusercontent.com/837d71efe3b865aebb1d9a9179ab5339d4226b08fb4c93b9268d3f208543ce5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465636e672f6c61726176656c2d696e65727469612d7472616e736c6174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codecng/laravel-inertia-translations)

A zero-configuration Laravel package that automatically exports your Laravel translations for use with Inertia.js. Supports both React and Vue, with full TypeScript support!

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

[](#installation)

```
composer require codecng/laravel-inertia-translations
```

That's it! No additional configuration needed.

Usage
-----

[](#usage)

Whenever you add or modify translations in your Laravel application, simply run:

```
php artisan translate
```

This command will:

1. Check if language files exist (if not, it will publish them automatically)
2. Process all your translation files (both JSON and PHP)
3. Generate JSON translation files in `resources/js/lang/`
4. Create appropriate utility files based on your stack (React/Vue + TypeScript)

### What Gets Processed

[](#what-gets-processed)

- ✅ JSON files in `lang/` directory
- ✅ PHP files in language subdirectories
- ✅ Automatically merges all translations by locale

### Generated Files Structure

[](#generated-files-structure)

```
resources/js/
├── lang/
│   ├── en.json
│   ├── es.json
│   └── fr.json
└── lib/
    └── translations.(js|ts|jsx|tsx)  # Based on your stack

```

Framework Support
-----------------

[](#framework-support)

### React

[](#react)

```
import { __ } from '@/lib/translations'

function Welcome() {
    return (

            {__('welcome.title')}
            {__('welcome.message')}
            {__('Users')}

    )
}
```

### Vue

[](#vue)

```

import { __ } from '@/lib/translations'

        {{ __('welcome.title') }}
        {{ __('welcome.message') }}

```

### Inertia Setup

[](#inertia-setup)

Make sure to include the current language in your Inertia shared props (in your HandleInertiaRequests middleware):

```
public function share(Request $request): array
{
    return array_merge(parent::share($request), [
        'language' => request()->user()->language ?? app()->getLocale(),
    ]);
}
```

Type Support
------------

[](#type-support)

When using TypeScript, you get full type support for your translation keys:

```
// The __ function is fully typed
__('welcome.title') // ✓ Valid
__('invalid.key')   // ✗ TypeScript error
```

Benefits
--------

[](#benefits)

- 🚀 Zero configuration required
- 🔄 Simple one-command updates
- 🛠 Works with both JSON and PHP translation files
- 💪 Full TypeScript support
- ⚡️ Supports both React and Vue
- 🔍 Automatic type generation for translation keys

Credits
-------

[](#credits)

- [Christian Negron](https://github.com/codecng)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance91

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~101 days

Total

5

Last Release

48d ago

PHP version history (2 changes)v1.0.0PHP ^8.3 || ^8.4

1.2.0PHP ^8.3 || ^8.4 || ^8.5

### Community

Maintainers

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

---

Top Contributors

[![ChristianJoniel](https://avatars.githubusercontent.com/u/21225974?v=4)](https://github.com/ChristianJoniel "ChristianJoniel (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelCodeCNGlaravel-inertia-translations

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/codecng-laravel-inertia-translations/health.svg)

```
[![Health](https://phpackages.com/badges/codecng-laravel-inertia-translations/health.svg)](https://phpackages.com/packages/codecng-laravel-inertia-translations)
```

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[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)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)[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)[outerweb/filament-translatable-fields

Filament integration for spatie/laravel-translatable

3582.9k8](/packages/outerweb-filament-translatable-fields)

PHPackages © 2026

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