Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Lang Sync Inertia

Laravel Lang Sync Inertia Laravel Package

erag/laravel-lang-sync-inertia

Syncs Laravel localization files with Inertia.js so frontend and backend share one translation source. Expose PHP lang strings as Inertia props, keep Vue/React text aligned with backend locales, and avoid duplicating translation management across your stack.

View on GitHub
Deep Wiki
Context7

Laravel Inertia.js localization package for Vue, React and Svelte with automatic translation syncing.

Frequently asked questions about Laravel Lang Sync Inertia
What is erag/laravel-lang-sync-inertia used for?
It syncs Laravel PHP language files with Inertia.js frontends so Vue, React, or Svelte can consume the same translations as the backend. It is glue code for sharing one translation source, not a full localization platform. Use it when Laravel remains the source of truth and your frontend needs generated JSON or JS artifacts or shared props. It does not replace ICU formatting, translation workflows, or a dedicated translation management system.
How do I install and configure it in a Laravel Inertia app?
Install via Composer using erag/laravel-lang-sync-inertia, then follow the repository README for any service provider, config publishing, and sync command. The evaluation describes a likely publishable config plus an artisan sync or export hook, but exact steps are not confirmed here. Start on a feature branch with existing lang files and a working Inertia frontend. Generate artifacts and compare them to your current frontend translations before replacing anything.
Which Laravel, PHP, Inertia, and Node versions are supported?
The provided context does not list exact version constraints or a test matrix. Check the package composer.json, release notes, and CI configuration for Laravel, PHP, Inertia, and Node compatibility. Because it has low adoption and zero dependents, prove compatibility in a time-boxed spike against your actual stack. Confirm both Inertia 1.x and 2.x behavior if those matter to you.
Does it support Inertia SSR and deferred props?
Inertia SSR and deferred props are listed as open questions in the technical evaluation, not confirmed features. Verify how locale data is shared in your SSR entry point and whether deferred props change when translations are loaded. SSR hydration mismatches are a known risk if locale data is shared inconsistently. Test both client-side and server-side rendering paths before production.
Is Laravel still the source of truth, or does the package modify language files?
The intended fit is Laravel PHP language files as the canonical source, with the package exposing or exporting those strings for the frontend. The evaluation warns to confirm whether the package only reads files or can mutate them during sync. Keep a fallback path using native __() calls and Inertia shared data. Do not let generated frontend files become the only copy of translations.
How are nested keys, namespaced translations, pluralization, and fallbacks handled?
The evaluation flags these as gaps to verify rather than documented guarantees. Test nested keys, package namespaces, plural forms, and fallback locale behavior with representative strings from your app. Compare generated output against Laravel's own translator results. If your app depends heavily on ICU messages or complex pluralization, keep a dedicated i18n layer.
Can I run the sync in CI and fail the build on missing keys?
A CI-friendly sync or export command is a key question, but the provided context does not confirm build-failing validation. If the package exposes an artisan command, wire it into CI and add your own missing-key check around it. Keep generated artifacts reproducible and fail when they drift from Laravel lang files. If that is not supported, an internal export script may be safer.
What are the production risks of using this package?
The main risk is longevity: it is a single-maintainer package with 66 stars, zero dependents, and a very recent release. Secondary risks include version drift, stale generated translation artifacts, SSR hydration mismatches, and bundle growth from shipping all locales. Mitigate by committing or building artifacts deterministically, testing locale switching, and keeping a native Laravel fallback. Treat it as a convenience accelerator, not a strategic dependency.
How should I handle active locale persistence and validation?
The evaluation lists locale persistence and validation as questions to answer, so confirm how the package reads the active locale. In many Laravel apps this is handled by route middleware, session, or a shared Inertia prop, but the package exact behavior is not stated. Validate locale codes against your supported list and define a fallback locale. Test switching locales across page visits and SSR requests.
What alternatives exist if I do not want this dependency?
You can share translations through Inertia shared props using Laravel native __() calls, or write a small artisan command that exports PHP lang files to JSON or JS for Vite. A dedicated translation management system or frontend i18n framework may fit larger workflows better. The package is best seen as an accelerator for syncing existing Laravel lang files, not the system of record. Keep the export format simple so you can replace it later.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo