catatsumuri/vue-starter-kit-i18n
| Install | |
|---|---|
composer require catatsumuri/vue-starter-kit-i18n |
|
| PHP: | ^8.3 |
| License: | MIT |
| Last Updated: | Aug 7, 2026 |
| Links: | GitHub · Packagist |
Laravel + Vue Starter Kit — i18n Edition
A fork of the official Laravel Vue starter kit with internationalization (i18n) built in.
What's different from the official kit
- Japanese pre-configured —
jalocale ships ready to use alongsideen - Translation pipeline —
lang/vendor-patches/controls which locales are generated; add a JSON file, runlang:update, done - Translations in Vue —
__()helper available in all Vue components via Inertia shared props - Session-based locale persistence — active locale survives page reloads via
LocalizationBySessionmiddleware
Requirements
- PHP 8.3+
- Node 20+
- A database supported by Laravel (SQLite works for local dev)
Adding a locale
Strings that only exist in this fork's Vue UI (login/2FA/profile screens, etc.) aren't part of the upstream laravel-lang/starter-kits package, so they're layered on top of it via lang/vendor-patches/:
lang/vendor-patches/source/vue.json— the English source strings this fork adds on top of the upstreamvue.json.lang/vendor-patches/locales/{locale}.json— translations of those strings for one locale. Seelang/vendor-patches/locales/ja.jsonfor a complete example.
To add a new locale (e.g. ko):
- If your components use custom strings not already listed in
lang/vendor-patches/source/vue.json, add them there first (English key/value pairs). - Create
lang/vendor-patches/locales/ko.jsonand translate every key fromsource/vue.json, following the same structure aslang/vendor-patches/locales/ja.json. A key can be left out only if upstream already ships a translation for it in that locale (ja.jsonskips"Warning"for this reason) — when in doubt, translate it anyway; the patch just overrides the upstream value. - Merge the patches into the vendor package and regenerate the translation files:
composer patch-vendor php artisan lang:update
composer patch-vendor (scripts/patch-vendor.php) merges everything under lang/vendor-patches/source/ and lang/vendor-patches/locales/ into the matching files inside vendor/laravel-lang/starter-kits/, taking your patch values over the upstream ones. lang:update then regenerates lang/{locale}.json and lang/{locale}/*.php for every locale it finds. patch-vendor also runs automatically after composer install/composer update, and lang:update runs automatically after composer update — but for a newly added locale, run both explicitly so the new locale is generated immediately.
Installation
laravel new my-app --using=https://github.com/catatsumuri/vue-starter-kit-i18n
cd my-app
composer setup
composer setup does the following in one shot:
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
npm install
npm run build
Development
composer dev
Starts four processes concurrently:
| Process | Command |
|---|---|
| HTTP server | php artisan serve |
| Queue worker | php artisan queue:listen |
| Log viewer | php artisan pail |
| Vite dev server | npm run dev |
Architecture
Backend packages
| Package | Role |
|---|---|
laravel-lang/common |
Core translation pipeline (lang:update command) |
laravel-lang/routes |
LocalizationBySession middleware |
erag/laravel-lang-sync-inertia |
Syncs lang/{locale}.json to Inertia shared props as lang |
laravel/wayfinder |
Type-safe route references on the frontend |
Frontend
- Vue 3 (Composition API) + TypeScript + Vite
- shadcn-vue + Reka UI components
- Tailwind CSS
@erag/lang-sync-inertia—lang()/__()composable for translations in Vue components
How translations reach the frontend
lang/ja.json
↓ HandleInertiaRequests::share()
Inertia shared prop: { lang: { "Log in": "ログイン", ... } }
↓ @erag/lang-sync-inertia
const { __ } = lang()
↓
__('Log in') → "ログイン"
Code quality
composer lint # PHP (Pint)
npm run lint # JS/TS (ESLint)
npm run types:check # TypeScript
composer test # PHPUnit / Pest
composer ci:check # all of the above
License
MIT
Related Packages
A fork of the official Laravel + Svelte starter kit with built-in internationali...
Laravel Localizer bridges Laravel translations to your SPA frontend (React/Vue/I...
A modern, focused localization extraction engine for Laravel 13. Discovers, extr...