ksuzuki2016/laravel-jetstream-lang-ja
Japanese language pack for Laravel Jetstream providing ready-made translations for Jetstream authentication and profile UI strings. Install via Composer and publish the language files to replace default English text with natural Japanese, simplifying localization for Laravel apps using Jetstream.
This release (1.0.1) is a Japanese localization pack for Jetstream, Livewire, and Fortify. The first use case is a Laravel app using Jetstream (Livewire stack) and Fortify where you want Japanese validation, authentication, password-reset, and UI strings instead of English defaults.
Minimal steps:
composer require <vendor>/<package>
php artisan vendor:publish --provider="<Vendor>\<Package>\<PackageServiceProvider>"
# or, if a tag is documented:
php artisan vendor:publish --tag=<package-lang>
config/app.php:
'locale' => 'ja',
'fallback_locale' => 'en',
php artisan optimize:clear
php artisan tinker
>>> __('auth.failed');
Where to look first:
lang/ja/ directory (Laravel 9+) or resources/lang/ja/ (older Laravel). Look for auth.php, passwords.php, validation.php, and any Jetstream/Fortify-specific files.publishes() method to see exact source/target paths and tags.config/app.php for locale and fallback_locale.config/fortify.php and config/jetstream.php if auth features or views are customized.First practical check: open a Jetstream registration or login page, submit invalid data, and confirm Livewire validation errors and Fortify auth failures appear in Japanese.
Global Japanese application
Set locale => 'ja' when the app is Japanese-only. This is the simplest pattern and covers Livewire validation messages (Livewire delegates validation to Laravel’s validator) and Fortify’s auth/password messages.
Per-user or per-request locale
For multi-language apps, keep locale as a default and switch per request with middleware:
public function handle($request, Closure $next)
{
app()->setLocale($request->user()?->locale ?? config('app.locale'));
return $next($request);
}
Place it after session/auth middleware so the user is available.
Publish-then-override
Treat published files as application-owned translations. Publish once, commit lang/ja/ to version control, and edit project-specific wording there. This avoids vendor edits and keeps upgrades predictable. If you need to refresh from a newer package release, republish with --force only after reviewing the diff.
Custom validation attribute names
Japanese validation messages often still show English field names (email, password). Add Japanese attribute names in lang/ja/validation.php:
'attributes' => [
'name' => '名前',
'email' => 'メールアドレス',
'password' => 'パスワード',
],
This is especially visible in Livewire forms and Fortify auth screens.
Fortify integration
Fortify uses Laravel’s auth.php, passwords.php, and validation.php keys for most flows. After publishing, test:
auth.failed)auth.throttle)passwords.sent, passwords.user, passwords.throttled, passwords.reset)If you have customized Fortify views, continue using __('...') so the published Japanese files are used.
Jetstream integration
For the Livewire stack, Jetstream’s Blade views and Livewire components use translation keys. Verify profile update, password update, team management (if enabled), and API token screens. If using the Inertia/Vue stack, check whether the package covers JavaScript-side strings; you may still need to translate frontend JSON/JS language files separately.
Testing pattern
Assert localized output in feature tests:
$this->get('/login')->assertSee('ログイン');
$this->post('/login', [])->assertSessionHasErrors('email');
For Livewire components, use Livewire::test(...)->assertHasErrors(...) and assert the Japanese message where relevant.
Deployment workflow
Commit published language files, run php artisan optimize:clear during deploy, and include a smoke test that resolves a few critical keys (auth.failed, validation.required, passwords.sent). Language files are not config-cached, but stale opcache/view cache can still make changes appear delayed.
ja. Publishing files alone does nothing if config/app.php still has locale => 'en'. Also check fallback_locale: missing Japanese keys will silently fall back to English.lang/ directory by default; older versions use resources/lang/. Confirm where the package publishes and where your app loads translations. If they differ, move or reconfigure.lang/ja/validation.php. If messages remain English, check locale and the validation file, not Livewire itself.vendor:publish prompts for a provider, select the package provider. If a tag is documented, prefer the tag to avoid publishing unrelated assets.composer update.--force carefully. Republishing can overwrite your project-specific Japanese wording. Review diffs before forcing.php artisan optimize:clear. In production, also ensure opcache is refreshed if language files changed.trans_choice. Japanese does not pluralize like English. Some validation or password throttling messages use pluralization; verify the output reads naturally.validation.attributes, users see Japanese messages containing English field names such as email. This is the most common polish issue in Livewire/Fortify forms.php artisan tinker and __('auth.failed'), __('validation.required'), __('passwords.sent'). Check app()->getLocale() and the loaded translation paths with app('translator')->getLoader()->namespaces() if necessary.composer.json if you need stability, and review release notes for missing or added keys before upgrading.lang/ja/ in your app. Laravel’s application language files take precedence over vendor package translations for the same group/key.How can I help you explore Laravel packages today?